I have the following code to allow the user to select one file at a time and to copy and paste the data after the last row containing data
I would like this amended so as to allow the user to select multiple files and the macro to copy and paste the data from each of these files
your assistance in this regard is most appreciated
I would like this amended so as to allow the user to select multiple files and the macro to copy and paste the data from each of these files
your assistance in this regard is most appreciated
Code:
Sub Open_Workbook()
ChDir ("C:\Sales Reports")
A:
Dim A As Variant
Dim LR As Long
If msg <> "" Then MsgBox msg
A = Application.GetOpenFilename
If A = False Or IsEmpty(A) Then Exit Sub
Application.ScreenUpdating = False
With Workbooks.Open(A)
msg = msg & vbCr & A
With Sheets(1)
.Range("a1", .Range("J" & Rows.Count).End(xlUp)).Copy _
Destination:=ThisWorkbook.Sheets("Data Import").Range("A" & Rows.Count).End(xlUp).Offset(1)
End With
.Close SaveChanges:=False
End With
answer = MsgBox("Does another file needs to be selected?", vbYesNo + vbQuestion, "Hello")
If answer = vbYes Then
GoTo A:
End If
Application.ScreenUpdating = True
End Sub