PDA

View Full Version : Solved: New Sheet Every Month



sswcharlie
12-14-2012, 04:44 PM
I have a line of code that copies the daily report and places in a archive for that month. A new sheet created for each month using Month/Year for the tab. All works ok new sheet set up, except that I have not worked out how to change the ref in the line below from ("Nov2012) to the next month ("Dec2012). This so that the copies for Dec wil go in the Dec sheet.





Sheets("DailyList").Range("DailyCopy").Copy
Destination:=Sheets("Nov2012").Range("C" &
Rows.Count).End(xlUp).Offset(7)


End Sub




In the line it needs something like..... =sheets(=date mmmyyyy).Range...

AmI getting close ?

Any comments would be appreciated.

Thanks

Charlie

p45cal
12-14-2012, 05:08 PM
well, the likes of:
sheets(format(date,"mmmyyyy")).select
selected a sheet called Dec2012 here.
But what do you do on the first day of the month, move the day before's data across?

sswcharlie
12-14-2012, 09:25 PM
Hi p45cal

Thanks works like magic. Had to make a small change in the format. Changed to mmm-yyyy (with a hyphen in the middle) to agree with the formatting I was using.

Thanks heaps

Charlie