Putting single dates across many pages - Microsoft Community


hi!  i'm trying create sheets in excel automatically fill in date , day on separate sheets (yeah, 365 total sheets).  need 1 page per day.  how can this?

thank help.

format sheet1 wish.

run macro copy sheet 365 times naming each 1-jan 1 through 31-dec

feb 29 sheet have added manually if needed

sheet1 can deleted after running.

sub makesheetforeachday()
'will copy sheet named "sheet1" , rename as
'as date, 1-jan, 2-jan, etc.
    dim wsstart worksheet
    dim strdate string
    dim mth long, dy long
    workbooks.add
    set wsstart = sheets("sheet1")
    mth = 1 12
        dy = 1 day(dateserial(year(now), mth + 1, 1) - 1)
            strdate = format(dateserial(year(now), mth, dy), "d-mmm")
            wsstart.copy after:=sheets(sheets.count)
            sheets(sheets.count).name = strdate
        next dy
    next mth
end sub

gord



Office / Excel / Other/unknown / Office 2013



Comments

Popular posts from this blog

Getting ErrorCode: 120018 when trying to access Microsoft account - Microsoft Community

The message was sent to a distribution list ‎(DL)‎ - Microsoft Community

Activation Error 0x8004FE93 - Microsoft Community