I am currently using the following to copy/paste from a downloaded workbook into an open workbook.
I would like to copy from DataGridExport.xlsx AND DataGridExport (1).xlsx. The ranges and destinations are the same. The only thing that changes is the (1) on the additional workbook. How would I do this?
VBA Code:
Sub Copynotice()
'enter correct path to Downloads folder
sFile = "C:\Users\User1\Dropbox\z_sync_do_not_delete\Downloads\DataGridExport.xlsx"
If Dir(sFile) = "" Then
MsgBox "Please download today's Report."
Exit Sub
End If
Dim wb1 As Workbook, wb2 As Workbook
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Set wb1 = ThisWorkbook
'enter correct path to Downloads folder
Set wb2 = Workbooks.Open("C:\Users\User1\Dropbox\z_sync_do_not_delete\Downloads\DataGridExport.xlsx")
wb2.Sheets("Report1").Range("E2:E120").Copy
wb1.Sheets("Notice").Range("D2").PasteSpecial Paste:=xlPasteValues
wb2.Close
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
I would like to copy from DataGridExport.xlsx AND DataGridExport (1).xlsx. The ranges and destinations are the same. The only thing that changes is the (1) on the additional workbook. How would I do this?