A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Setting up and Configuration
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Inserting Date in worksteets



 
 
Thread Tools Display Modes
  #11  
Old January 7th, 2004, 03:51 AM
Dave Peterson
external usenet poster
 
Posts: n/a
Default Inserting Date in worksteets

I read David's reply and assumed that his point (hidden by the renaming stuff)
was that if the sheets weren't in the correct order, then the OP may not get the
intended result.

But I've always read posts the way I want to--not the way they're written!


Gord, Dibben wrote:

David

Dave's code re-names nothing. It just increments the date in E8 across all
worksheets.

Gord

On Tue, 6 Jan 2004 21:51:30 -0500, "David McRitchie"
wrote:

I would think you would want to add sheets to the workbook
and name them rather than changing the name of existing worksheets.
But then you answered in the manner that the poster asked.
I guess all of the sheets would have to have the same information
in them so it doesn't matter what gets named to a particular date.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Dave Peterson" wrote in message ...
You could use a macro:

Option Explicit
Sub testme()
Dim myDate As Date
Dim iCtr As Long

myDate = DateSerial(2004, 1, 1)

For iCtr = 1 To Worksheets.Count
With Worksheets(iCtr).Range("e8")
.Value = myDate - 1 + iCtr
.NumberFormat = "mm/dd/yyyy"
End With
Next iCtr

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Vic Abrahamian wrote:

I have a work book which has 30 worksheets. Excel 2000
Is there a way with which I could add a date to a
specific cell and then increment the first day by one day
I want cell E8 to in each work sheet to show 1/1/04,
1/2/04, 1/3/04, 1/4/04, 1/5/04 etc..
Thank you

--

Dave Peterson



--

Dave Peterson

  #12  
Old January 7th, 2004, 03:55 AM
Gord Dibben
external usenet poster
 
Posts: n/a
Default Inserting Date in worksteets

Caveat Emptorg

OP wanted an incremented date in E8. Dave provided that. OP must/should know
that E8 is blank on each sheet before running the code.

Gord

On Tue, 6 Jan 2004 22:36:33 -0500, "David McRitchie"
wrote:


You're correct Gord, I didn't read it very well, but the comment seems
just as valid because =it is done without regard to any preexisting content
of the worksheets.



Gord Dibben wrote in message news
David

Dave's code re-names nothing. It just increments the date in E8 across all
worksheets.

Gord

On Tue, 6 Jan 2004 21:51:30 -0500, "David McRitchie"
wrote:

I would think you would want to add sheets to the workbook
and name them rather than changing the name of existing worksheets.
But then you answered in the manner that the poster asked.
I guess all of the sheets would have to have the same information
in them so it doesn't matter what gets named to a particular date.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Dave Peterson" wrote in message ...
You could use a macro:

Option Explicit
Sub testme()
Dim myDate As Date
Dim iCtr As Long

myDate = DateSerial(2004, 1, 1)

For iCtr = 1 To Worksheets.Count
With Worksheets(iCtr).Range("e8")
.Value = myDate - 1 + iCtr
.NumberFormat = "mm/dd/yyyy"
End With
Next iCtr

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Vic Abrahamian wrote:

I have a work book which has 30 worksheets. Excel 2000
Is there a way with which I could add a date to a
specific cell and then increment the first day by one day
I want cell E8 to in each work sheet to show 1/1/04,
1/2/04, 1/3/04, 1/4/04, 1/5/04 etc..
Thank you

--

Dave Peterson





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:50 PM.


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