Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update Timecard to new year
Hello,
I'd like to update a time card file to the 2008. It contains 26 worksheets, each worksheet contains 14 dates. For example 1/2/07 would become 1/1/08. For dates after Feb 28th, for example 3/5/07 would become 3/3/08. Is there a formula that would make these conversions? Sounds like I'd need one for before Feb 28th and a second for after Feb 28th. Thanks in advance. Ellen |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update Timecard to new year
This is real easy. You don't have to worry about leap year. Just add 364 to
the date. the string on the wroksheet name has to be a valid date format that excel recognizes. I named my worksheets 1-2-07 (you can't use slashes in worksheet names like your example. This code will work real well. Sub update() For Each ws In Worksheets WSDate = DateValue(ws.Name) NewWSDate = WSDate + 364 NewWSName = Format(NewWSDate, "mm-dd-yy") ws.Name = NewWSName Next ws End Sub "EllenM" wrote: Hello, I'd like to update a time card file to the 2008. It contains 26 worksheets, each worksheet contains 14 dates. For example 1/2/07 would become 1/1/08. For dates after Feb 28th, for example 3/5/07 would become 3/3/08. Is there a formula that would make these conversions? Sounds like I'd need one for before Feb 28th and a second for after Feb 28th. Thanks in advance. Ellen |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update Timecard to new year
Thanks, Joel. I actually needed to change dates within the worksheet--not
the worksheet name. The dates are formatted as d-mmm. "Joel" wrote: This is real easy. You don't have to worry about leap year. Just add 364 to the date. the string on the wroksheet name has to be a valid date format that excel recognizes. I named my worksheets 1-2-07 (you can't use slashes in worksheet names like your example. This code will work real well. Sub update() For Each ws In Worksheets WSDate = DateValue(ws.Name) NewWSDate = WSDate + 364 NewWSName = Format(NewWSDate, "mm-dd-yy") ws.Name = NewWSName Next ws End Sub "EllenM" wrote: Hello, I'd like to update a time card file to the 2008. It contains 26 worksheets, each worksheet contains 14 dates. For example 1/2/07 would become 1/1/08. For dates after Feb 28th, for example 3/5/07 would become 3/3/08. Is there a formula that would make these conversions? Sounds like I'd need one for before Feb 28th and a second for after Feb 28th. Thanks in advance. Ellen |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update Timecard to new year
Hi again,
I actually got it. Enter 364 in an empty cell Copy that cell: EditCopy Now, select the range of cells you want to increase Then do: EditPaste SpecialaddOK reformat cells to desired date format Clear the 364 from the cell. No programming necessay!! "Joel" wrote: This is real easy. You don't have to worry about leap year. Just add 364 to the date. the string on the wroksheet name has to be a valid date format that excel recognizes. I named my worksheets 1-2-07 (you can't use slashes in worksheet names like your example. This code will work real well. Sub update() For Each ws In Worksheets WSDate = DateValue(ws.Name) NewWSDate = WSDate + 364 NewWSName = Format(NewWSDate, "mm-dd-yy") ws.Name = NewWSName Next ws End Sub "EllenM" wrote: Hello, I'd like to update a time card file to the 2008. It contains 26 worksheets, each worksheet contains 14 dates. For example 1/2/07 would become 1/1/08. For dates after Feb 28th, for example 3/5/07 would become 3/3/08. Is there a formula that would make these conversions? Sounds like I'd need one for before Feb 28th and a second for after Feb 28th. Thanks in advance. Ellen |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Update Timecard to new year
I told you it was EASY
"EllenM" wrote: Hi again, I actually got it. Enter 364 in an empty cell Copy that cell: EditCopy Now, select the range of cells you want to increase Then do: EditPaste SpecialaddOK reformat cells to desired date format Clear the 364 from the cell. No programming necessay!! "Joel" wrote: This is real easy. You don't have to worry about leap year. Just add 364 to the date. the string on the wroksheet name has to be a valid date format that excel recognizes. I named my worksheets 1-2-07 (you can't use slashes in worksheet names like your example. This code will work real well. Sub update() For Each ws In Worksheets WSDate = DateValue(ws.Name) NewWSDate = WSDate + 364 NewWSName = Format(NewWSDate, "mm-dd-yy") ws.Name = NewWSName Next ws End Sub "EllenM" wrote: Hello, I'd like to update a time card file to the 2008. It contains 26 worksheets, each worksheet contains 14 dates. For example 1/2/07 would become 1/1/08. For dates after Feb 28th, for example 3/5/07 would become 3/3/08. Is there a formula that would make these conversions? Sounds like I'd need one for before Feb 28th and a second for after Feb 28th. Thanks in advance. Ellen |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Replace update year in date | Excel Discussion (Misc queries) | |||
Date question? update year. | Excel Worksheet Functions | |||
timecard | Excel Discussion (Misc queries) | |||
Timecard | Excel Discussion (Misc queries) | |||
automatically update WordArt when calandar year is changed | Excel Programming |