fangfacekitty
Board Regular
- Joined
- Jul 28, 2010
- Messages
- 63
I have a functioning macro in a synthesis workbook that prompts the user to open a data file workbook, copy specific cells and then paste the data into the synthesis workbook, into the next available row (the macro does the copy/paste, not the user).
This part works well.
Where I now have a problem is the macro references the name of the synthesis workbook...but this name will change every week. The tab names will not change but the workbook name itself will, based on the calendar week.
Is there a way to code the macro so it still pastes the data into the open synthesis workbook without actually referencing its name? Only one synthesis workbook would be open/used per week (this is actually an agenda for a weekly meeting, which is why the workbook name changes, and the data will be completely different from week to week).
I am, unfortunately, still using Excel 2003.
This is the section of the macro, the bit in red is where I have the problem (the xx at the end of the file name is what will change each week) :
'' paste to the destination
Workbooks("Draft - SC AGENDA 2012 CWxx.xls").Activate
Set destSheet = Worksheets("SC ASIA")
destSheet.Activate
destSheet.Range(Cells(1 + Rank, 4), Cells(1 + Rank, 50)).PasteSpecial (xlPasteValues)
Thanks in advance for any help you can provide.
This part works well.
Where I now have a problem is the macro references the name of the synthesis workbook...but this name will change every week. The tab names will not change but the workbook name itself will, based on the calendar week.
Is there a way to code the macro so it still pastes the data into the open synthesis workbook without actually referencing its name? Only one synthesis workbook would be open/used per week (this is actually an agenda for a weekly meeting, which is why the workbook name changes, and the data will be completely different from week to week).
I am, unfortunately, still using Excel 2003.
This is the section of the macro, the bit in red is where I have the problem (the xx at the end of the file name is what will change each week) :
'' paste to the destination
Workbooks("Draft - SC AGENDA 2012 CWxx.xls").Activate
Set destSheet = Worksheets("SC ASIA")
destSheet.Activate
destSheet.Range(Cells(1 + Rank, 4), Cells(1 + Rank, 50)).PasteSpecial (xlPasteValues)
Thanks in advance for any help you can provide.