R
rglasunow
Someone helped me with the code to merge all the files under one folder
onto one spreadsheet. However, from the code below is there a way I
can tell Excel to open a file and copy from a specific worksheet?
Application.ScreenUpdating = False
Dim FName As String
Dim WB As Workbook
Dim Dest As Range
Const FOLDERNAME = "" ChDrive FOLDERNAME
ChDir FOLDERNAME
Set Dest = Range("A2")
FName = Dir("*.xls")
Do Until FName = ""
Set WB = Workbooks.Open(FName)
WB.Worksheets(1).Rows(2).Copy Destination:=Dest
WB.Close savechanges:=False
Set Dest = Dest(2, 1)
FName = Dir()
Loop
End Sub
Thank you!!
onto one spreadsheet. However, from the code below is there a way I
can tell Excel to open a file and copy from a specific worksheet?
Application.ScreenUpdating = False
Dim FName As String
Dim WB As Workbook
Dim Dest As Range
Const FOLDERNAME = "" ChDrive FOLDERNAME
ChDir FOLDERNAME
Set Dest = Range("A2")
FName = Dir("*.xls")
Do Until FName = ""
Set WB = Workbooks.Open(FName)
WB.Worksheets(1).Rows(2).Copy Destination:=Dest
WB.Close savechanges:=False
Set Dest = Dest(2, 1)
FName = Dir()
Loop
End Sub
Thank you!!