Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I currently have a worksheet that uses VBA code which creates a worksheet for
each day of the month using the MMM-d date format. It works fine this way but it would be better if I could get it to name each sheet as 1st through 31st NOT Jan-1 through Jan-31. A section of the code follows: Do While i < 32 'counting 31 loops If Month(firstday + i) = mon Then 'checking to see if 31st day is still within the month dayofweek = Weekday(firstday + i) 'retrieving day of the week from date currentday = firstday + i 'calculating loop date currentday = Format(currentday, "mmm-d") 'formatting loop day for tab name Select Case dayofweek 'choosing correct kind of template Case 1, 7 'weekend template Sheets("Summer Weekend").Select 'select weekend template Sheets("Summer Weekend").Copy Befo=Sheets(1) 'pasting copy as first Sheets("Summer Weekend (2)").Select Sheets("Summer Weekend (2)").Name = currentday 'changing tab name to loop date Case 2, 3, 4, 5, 6 'weekday template Sheets("Summer Weekday").Select Sheets("Summer Weekday").Copy Befo=Sheets(1) Sheets("Summer Weekday (2)").Select Sheets("Sum |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
help with passing date to access as parameter query(code included) | Excel Programming | |||
How would I write a max formula that included color formats? | Excel Discussion (Misc queries) | |||
how do i change or make this macro??? pictures and code included | Excel Programming | |||
how do i change or make this macro??? pictures and code included | Charts and Charting in Excel | |||
How to Change Date Formats | Excel Discussion (Misc queries) |