I have a macro to open a workbook and to copy the data where the sheet names are the same on the destination workbook
If there is a sheet name on the source workbook that is not on the destination workbook, I would like this to be created
Your assistance is most apprecited
If there is a sheet name on the source workbook that is not on the destination workbook, I would like this to be created
Code:
Sub Open_Files()
Dim nb As Workbook, tw As Workbook, ts As Worksheet, shtCount%
A = Application.GetOpenFilename
If A = False Or IsEmpty(A) Then Exit Sub
With Application
.ScreenUpdating = False
End With
Set tw = ThisWorkbook
Set nb = Workbooks.Open(A)
With nb
For shtCount = 1 To .Sheets.Count
.Sheets(shtCount).UsedRange.Copy Destination:=tw.Sheets(shtCount).Range("A1") 'change to suit ones needs
Next shtCount
.Close False
End With
Set nb = Nothing
Set tw = Nothing
With Application
.ScreenUpdating = True
End With
End Sub
Your assistance is most apprecited