D
Dennis
Using XL 2003 & 97
Need help with the following VBA code:
Sub Macro1()
Dim myNewWorkbook As String
myNewWorkbook = ActiveWorkbook.Name
Workbooks.Open Filename:="OldWorkbookFile.xls"
Sheets(Array("Formulas", "Department Lables")).Activate
Sheets(Array("Formulas", "Department Lables")).Copy _
Before:=Workbooks(myNewWorkbook).Sheets(2)
Windows("OldWorkbookFile.xls").Activate
ActiveWorkbook.Close
Windows(myNewWorkbook).Activate
' ........
End Sub
My goal is to have myNewWorkbook active then:
1) Open OldWorkbookFile
2) Select two sheets in OldWorkbookFile ("Formulas", "Department Lables")
3) Copy those sheets to myNewWorkbook
4) Close OldWorkbookFile
5) Return to myNewWorkbook
Obviously I do not have the syntax correct.
TIA Dennis
Need help with the following VBA code:
Sub Macro1()
Dim myNewWorkbook As String
myNewWorkbook = ActiveWorkbook.Name
Workbooks.Open Filename:="OldWorkbookFile.xls"
Sheets(Array("Formulas", "Department Lables")).Activate
Sheets(Array("Formulas", "Department Lables")).Copy _
Before:=Workbooks(myNewWorkbook).Sheets(2)
Windows("OldWorkbookFile.xls").Activate
ActiveWorkbook.Close
Windows(myNewWorkbook).Activate
' ........
End Sub
My goal is to have myNewWorkbook active then:
1) Open OldWorkbookFile
2) Select two sheets in OldWorkbookFile ("Formulas", "Department Lables")
3) Copy those sheets to myNewWorkbook
4) Close OldWorkbookFile
5) Return to myNewWorkbook
Obviously I do not have the syntax correct.
TIA Dennis