Hello All,
I've been asked by my boss to create a macro that will quickly backup the whole file I'm working on into a new workbook. Here's the kicker, only the data. Simply copying the worksheets won't work since there is code embedded in the worksheets themselves. So the best I could come up with was to select and copy the cells directly since this would override any and all code I've written in. Please see my code below. It keeps failing at two parts. I'll label it in the code.
Sub Save_Data()
Dim newwb As Workbook
Dim orgwb As Workbook
Application.ScreenUpdating = False
Set orgwb = ActiveWorkbook
Set newwb = Workbooks.Add
orgwb.Worksheets("Full List").Select 'Fails on this line
Range("A1:G3000").Select
Selection.Copy
newwb.Sheets("Sheet1").Select 'And again on this line
Range("A1").Select
Selection.PasteSpecial
Application.ScreenUpdating = True
End Sub
Any help would be great. Also since I intend to do this for multiple worksheets in the same workbook any help to speed it up would be great. Of course the selection range for each would need to be different.
Thanks,
Dan
Bookmarks