Hi all,
I am trying to copy some sheets from one workbook into another. It works if I specify a destination workbook name but the name of the destination workbook will change depending on the week of the year. This name is stored in a variable. When i use the variable in the copy the VBA code falls over.
The code I am using is similar to this :-
Sheets(Array("Sheet1","Sheet2")).Copy Before:=Workbooks("Workbook2").Sheets (3)
What I want to be able to do is replace workbook to with a variable. Something like:-
WrkBook2="Week 2"
Sheets(Array("Sheet1","Sheet2")).Copy Before:=Workbooks(Wrkbook2).Sheets (3)
Thanks for any help
Alan
I am trying to copy some sheets from one workbook into another. It works if I specify a destination workbook name but the name of the destination workbook will change depending on the week of the year. This name is stored in a variable. When i use the variable in the copy the VBA code falls over.
The code I am using is similar to this :-
Sheets(Array("Sheet1","Sheet2")).Copy Before:=Workbooks("Workbook2").Sheets (3)
What I want to be able to do is replace workbook to with a variable. Something like:-
WrkBook2="Week 2"
Sheets(Array("Sheet1","Sheet2")).Copy Before:=Workbooks(Wrkbook2).Sheets (3)
Thanks for any help
Alan