반응형
반응형

'Music' 카테고리의 다른 글

Ugly - 2NE1  (0) 2011.08.25
동경 - 박효신  (0) 2011.08.25
It's a fine day - Opus III  (0) 2011.07.19
Lonely : 2NE1  (0) 2011.05.24
Don't cry : Park, Bom  (0) 2011.05.19
반응형

'Music' 카테고리의 다른 글

동경 - 박효신  (0) 2011.08.25
Hot Summer - fx  (0) 2011.07.22
Lonely : 2NE1  (0) 2011.05.24
Don't cry : Park, Bom  (0) 2011.05.19
4Minute : 거울아 / Heart to heart  (0) 2011.05.16

http://kin.naver.com/qna/detail.nhn?d1id=1&dirId=102020101&docId=72846894&qb=7JeR7IWA7YyM7J28IOyXtOyngCDslYrqs6Ag7JeF642w7J207Yq4&enc=utf8&section=kin&rank=3&search_sort=0&spq=0
 

Sub Macro1()

Dim rng As Range, rngList As Range
Dim strVar As String, strFile As String
  Set rngList = Range(Cells(2, 1), Cells(Rows.Count, 1).End(3))
  With Application
    .ScreenUpdating = False
    .DisplayAlerts = False
   For Each rng In rngList
   strFile = ThisWorkbook.Path & Application.PathSeparator & rng.Value & ".xls"
   If Dir(strFile) <> Empty Then
    Workbooks.Open Filename:=ThisWorkbook.Path & "\" & rng.Value & ".xls"
       strVar = Sheets("Ratio").Range("B38").Value
         rng.Next = IIf(strVar = "비율산정 없음", "-", strVar)
        ActiveWorkbook.Close
        Else
          rng.Next = "Skip"
        End If
      Next rng
       .ScreenUpdating = True
      .DisplayAlerts = True
  End With
End Sub

반응형

http://kin.naver.com/qna/detail.nhn?d1id=1&dirId=102020101&docId=71906817&qb=7JeR7IWA7YyM7J28IOyXtOyngCDslYrqs6Ag7JeF642w7J207Yq4&enc=utf8&section=kin&rank=2&search_sort=0&spq=0

안녕하세요~

excell4.0메크로를 사용하시면 될듯합니다.

 

불러올 파일과 기록할 파일이 같은 폴더에 있다고 가정합니다.

 

불러올 파일 이름이 XLM_1.XLS 일때

기록할 파일의 B2:B4셀에

XLM_1.XLS 파일의 Sheet1 시트의 A1:A3셀의 데이타를 불러오는 경우의 코드입니다.

참조하시고 좋은 결과 있으시길~~~

 

Option Explicit

 

Sub Call_Data()
Dim strPath As String, strFile As String, strSht As String, strCell As String
Dim i As Integer

 

strPath = ThisWorkbook.Path & "\"
strFile = "XLM_1.xls"
strSht = "Sheet1"


For i = 0 To 2
    strCell = Range("a1").Offset(i, 0).Address
    Range("b2").Offset(i, 0) = Get_Data(strPath, strFile, strSht, strCell)
Next

End Sub

 

 

 

Function Get_Data(Path, File, Sht, Cell)

Dim strD As String
   

strD = "'" & Path & "[" & File & "]" & Sht & "'!" & Range(Cell).Address(, , xlR1C1)
Get_Data = ExecuteExcel4Macro(strD)

End Function

 

반응형

+ Recent posts