Hi
I'm using Excel 2003.
Sorry but I'm still confused on what to use when trying to apply something to the new workbook that I've saved versus the one that I'm copying.
So now if I wish to reference the new worksheet of WBCopy is that the activeworkbook? Do I need to create a dimension and set the workbook as the file of "E:\My Documents\MyFolder\WBCopy_" & Format(Now(), "YYYYMMDD") & ".xls"?
All help greatly appreciated. Thanks.
I'm using Excel 2003.
Sorry but I'm still confused on what to use when trying to apply something to the new workbook that I've saved versus the one that I'm copying.
Code:
Sub copyWorkbook()
Application.ScreenUpdating = False
Sheets(Array("wsA", "wsB", "wsC", "wsD")).Copy
Application.DisplayAlerts = False
Application.CutCopyMode = False
If ThisWorkbook.Name = "E:\My Documents\MyFolder\WBCopy_" & Format(Now(), "YYYYMMDD") & ".xls" Then Exit Sub
ActiveWorkbook.SaveCopyAs Filename"E:\My Documents\MyFolder\WBCopy_" & Format(Now(), "YYYYMMDD") & ".xls"
Application.ScreenUpdating = True
End Sub
So now if I wish to reference the new worksheet of WBCopy is that the activeworkbook? Do I need to create a dimension and set the workbook as the file of "E:\My Documents\MyFolder\WBCopy_" & Format(Now(), "YYYYMMDD") & ".xls"?
All help greatly appreciated. Thanks.