patrick200
New Member
- Joined
- Jan 14, 2013
- Messages
- 21
Hi all
I'm trying to copy one sheet and insert it to another existing workbook (storing it for future reference)..... It will copy the sheet but it also copies over the other sheets already in the workbook..........I have no idea what I've done wrong
I'm using Excel 2010 on Windows7
here's the code I have so far
Sub Sample()
Workbooks.Open Filename:=("C:\Users\laptop\Desktop\SAVEDSCHEDULE.xlsx")
Windows("Test Schedule - Copy.xlsm").Activate
Sheets("Sheet3").Select
Sheets("Sheet3").Copy Before:=Workbooks("SAVEDSCHEDULE.xlsx").Sheets(1)
Application.DisplayAlerts = False
Workbooks("SAVEDSCHEDULE.xlsx").SaveAs "C:\Users\laptop\Desktop\SAVEDSCHEDULE.xlsx"
Application.DisplayAlerts = True
Workbooks("SAVEDSCHEDULE.xlsx").Close
End Sub
Thanks.......Pat
I'm trying to copy one sheet and insert it to another existing workbook (storing it for future reference)..... It will copy the sheet but it also copies over the other sheets already in the workbook..........I have no idea what I've done wrong
I'm using Excel 2010 on Windows7
here's the code I have so far
Sub Sample()
Workbooks.Open Filename:=("C:\Users\laptop\Desktop\SAVEDSCHEDULE.xlsx")
Windows("Test Schedule - Copy.xlsm").Activate
Sheets("Sheet3").Select
Sheets("Sheet3").Copy Before:=Workbooks("SAVEDSCHEDULE.xlsx").Sheets(1)
Application.DisplayAlerts = False
Workbooks("SAVEDSCHEDULE.xlsx").SaveAs "C:\Users\laptop\Desktop\SAVEDSCHEDULE.xlsx"
Application.DisplayAlerts = True
Workbooks("SAVEDSCHEDULE.xlsx").Close
End Sub
Thanks.......Pat