|
▼YAYA999 さん:
別案で変数で処理
Dim myFld As String, myName As String
Dim v As Variant
Dim sakiRng As Range, motoRng As Range, myBook As Workbook
myFld = ThisWorkbook.Path & "\○○○" '←フォルダ
myName = Dir(myFld & "\*.xls")
Do While myName <> ""
Set sakiRng = Range("B65536").End(xlUp).Offset(1)
Set myBook = Workbooks.Open(Filename:=myFld & "\" & myName)
Set motoRng = myBook.Names("転記用テーブル").RefersToRange
' Set motoRng = motoRng.Rows("2:" & motoRng.Rows.Count)
v = motoRng.Rows("2:" & motoRng.Rows.Count).Value
sakiRng.Resize(UBound(v), UBound(v, 2)).Value = v
myBook.Clos
myName = Dir()
Loop
|
|