I am writing an excel macro that is designed to cycle through worksheets copying sections and pasting them in a different workbook with the same worksheet names. Each actual sheet name stands for a friday in the quarter (13 sheets), so tomorrow is 071114 for July 11th, 2014.
I have set a vba variables week1 - week13 to those tab names. I want the For loop below to cycle through week1 to week13, but it isn't working the way I want it to because the computer is searching for a tab named "week1" instead of the variable week1. I think I am going to just change the tab names, but I was wondering for future reference if there is a way to do this.
For x = 1 To 13
wbD.Activate
Worksheets("week" & x).Activate
Range(carange).Select
Selection.Copy
wbC.Activate
Worksheets("week" & x).Activate
Range(carange).Select
ActiveSheet.Paste
Next x