Consulting

Results 1 to 3 of 3

Thread: Solved: New Sheet Every Month

  1. #1

    Solved: New Sheet Every Month

    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.



    [VBA]

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


    End Sub

    [/VBA]


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

    AmI getting close ?

    Any comments would be appreciated.

    Thanks

    Charlie

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    well, the likes of:
    [VBA]sheets(format(date,"mmmyyyy")).select[/VBA]
    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?
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •