Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Modify dates byr referencing a cell name

Here is the situation:

I have 52 sheets each named by week, ie: May 5-May 11; May 12-May 18 etc.
I have a cell in each sheet that references the beginning date of each
sheet. Ie May 5; May 12 etc
As I am preparing 52 sheets I would prefer not to have to fill in the date
in each cell, in each sheet, or formulate by referencing the end date in
the previos sheet and adding one. I would like to have a macro do it, but
haven't much success so far. Of course I would have done manually by now
for the time taken to figure this out. :(
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Modify dates byr referencing a cell name

Robin,

Sub TryNow()
Dim myS As Worksheet
Dim myDate As Date
myDate = DateValue("5/5/2008")
For Each myS In Worksheets
myS.Range("A1").Value = myDate
myDate = myDate + 7
Next myS
End Sub

Of course, change the Starting date and the cell in which you write the date.

Note that what you are doing is typical of poor workbook design. Much better would be to use a
database, with a column of dates along with the other values. Then you could slice and dice your
data using Pivot Tables and filters, without having 52 sheets......

HTH,
Bernie
MS Excel MVP


"Robin" wrote in message ...
Here is the situation:

I have 52 sheets each named by week, ie: May 5-May 11; May 12-May 18 etc.
I have a cell in each sheet that references the beginning date of each sheet. Ie May 5; May 12
etc
As I am preparing 52 sheets I would prefer not to have to fill in the date in each cell, in each
sheet, or formulate by referencing the end date in the previos sheet and adding one. I would like
to have a macro do it, but haven't much success so far. Of course I would have done manually by
now for the time taken to figure this out. :(
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Modify dates byr referencing a cell name

Thanks! I only wish I knew databases!


On Wed, 30 Apr 2008 11:42:40 -0600, Bernie Deitrick <deitbe consumer dot
org wrote:

Robin,

Sub TryNow()
Dim myS As Worksheet
Dim myDate As Date
myDate = DateValue("5/5/2008")
For Each myS In Worksheets
myS.Range("A1").Value = myDate
myDate = myDate + 7
Next myS
End Sub

Of course, change the Starting date and the cell in which you write the
date.

Note that what you are doing is typical of poor workbook design. Much
better would be to use a
database, with a column of dates along with the other values. Then you
could slice and dice your
data using Pivot Tables and filters, without having 52 sheets......

HTH,
Bernie
MS Excel MVP


"Robin" wrote in message
...
Here is the situation:

I have 52 sheets each named by week, ie: May 5-May 11; May 12-May 18
etc.
I have a cell in each sheet that references the beginning date of each
sheet. Ie May 5; May 12
etc
As I am preparing 52 sheets I would prefer not to have to fill in the
date in each cell, in each
sheet, or formulate by referencing the end date in the previos sheet
and adding one. I would like
to have a macro do it, but haven't much success so far. Of course I
would have done manually by
now for the time taken to figure this out. :(
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/






--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Modify dates byr referencing a cell name

Thanks! I only wish I knew databases!

Well, here's a good opportunity to give it a try...

Bernie



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
referencing dates PK Excel Discussion (Misc queries) 4 October 28th 07 10:32 AM
Modify a cell Vern Excel Discussion (Misc queries) 0 January 19th 07 08:51 PM
Modify cell contents oldguywithbadeyes Excel Discussion (Misc queries) 2 May 2nd 06 10:20 PM
Modify Cell Sizes Louanne Excel Worksheet Functions 1 January 1st 06 12:30 AM
Modify Cell sizes Louanne Excel Worksheet Functions 3 December 31st 05 05:02 PM


All times are GMT +1. The time now is 05:35 PM.

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"