Gingertrees
Well-known Member
- Joined
- Sep 21, 2009
- Messages
- 697
I create a new workbook each day (titled as PREV.DAY'SDATE) by copying the previous day's workbook and changing the file name. I recorded a macro in today's workbook, and everything about it will work except all the mentions of the filename. How can I change all mentions of "9Aug11.xls" to the current filename, be that "10Aug11.xls", or later "8Sept11.xls", etc.?
Here's a little sample of code to change:
Here's a little sample of code to change:
Code:
Windows("text1.txt").Activate
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Windows("9Aug11.xls").Activate
Range("B5").Select
ActiveSheet.Paste
Windows("text2.txt").Activate
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Application.CutCopyMode = False
Selection.Copy
Windows("9Aug11.xls").Activate