View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Serial Date in Multiple Worksheet

You can change this line to point at the cell you want:
From:
myDate = DateSerial(2005, 12, 27)
to:
myDate = worksheets("sheet99").range("a1").value

Change the sheet name and the cell address to what you need.


John wrote:

Hi, the script works great. I do have one problem.

The line "myDate = DateSerial(2005, 12, 27)". The way the script is written
I would need to edit the script to get the correct dates.

What I am hoping to do is enter the date from the cell in the first
worksheet and then run the macro replic to the other sheets.

Thanks

"Gord Dibben" wrote:

John

Sub Date_Increment()
''increment a date in A4 across sheets
Dim myDate As Date
Dim iCtr As Long
myDate = DateSerial(2005, 12, 27)
For iCtr = 1 To Worksheets.Count
With Worksheets(iCtr).Range("A4")
.Value = myDate - 1 + iCtr
.NumberFormat = "mm/dd/yyyy"
End With
Next iCtr
End Sub


Gord Dibben Excel MVP

On Mon, 26 Dec 2005 23:05:02 -0800, "John"
wrote:

Thanks, I will :)

"Max" wrote:

Sorry for the mis-interp, John !
I don't have further ideas to offer here

Do hang around awhile for insights from others
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--





--

Dave Peterson