Hello everyone - i have found below VBA code for Copy data from multiple workbooks in this forum which is perfectly ok
now i just want to change folder path because my folder is not on same location
please help me to change folder path location - dynamic - so i can choose or pick multiple excel files
now i just want to change folder path because my folder is not on same location
please help me to change folder path location - dynamic - so i can choose or pick multiple excel files
Rich (BB code):
Sub CopyRange()
Application.ScreenUpdating = False
Dim wkbDest As Workbook
Dim wkbSource As Workbook
Set wkbDest = ThisWorkbook
Dim LastRow As Long
Const strPath As String = " C:\Users\xbv\Desktop\group1\"
ChDir strPath
strExtension = Dir("*.xls*")
Do While strExtension <> ""
Set wkbSource = Workbooks.Open(strPath & strExtension)
With wkbSource
LastRow = .Sheets("appendix B").Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
.Sheets("appendix B").Range("C6:F" & LastRow).Copy wkbDest.Sheets("Master").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
.Close savechanges:=False
End With
strExtension = Dir
Loop
Application.ScreenUpdating = True
End Sub
Last edited by a moderator: