Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace update year in date Jeff C Excel Discussion (Misc queries) 6 April 28th 08 10:38 PM
Date question? update year. Jman Excel Worksheet Functions 7 April 2nd 08 06:47 AM
timecard vdmbqb Excel Discussion (Misc queries) 1 February 26th 08 01:26 AM
Timecard Michaela Excel Discussion (Misc queries) 6 January 3rd 06 01:50 PM
automatically update WordArt when calandar year is changed W.J.Surrarrer Excel Programming 0 May 16th 04 04:15 AM


All times are GMT +1. The time now is 10:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"