spread sheet

J

jkf

first off i hope this is the right place for this question

at work we have a spread sheet that we need on a day to day basis, that is
easy enough , but now as it is a 24/7 buisness the powers that be have asked
for each spread sheet to include the 3 shifts ie Days 01.01.01 Lates
01.01.01. Nights 01.01.01

the formula i have been using for the day to day all shift log is

SUB ADDSHEET()

FOR G = 31 TO 1 STEP - 1

SHEETS.ADD.NAME = G & ".10.06"

NEXT G

END SUB

which works great i just ammend it to suit month and number of days in
month.

so question is how do i do it so it will include the 3 shifts for each day
of month

tia
jkf
 
D

Dave Peterson

Maybe you can use something like this:

Option Explicit
Sub AddSheets()

Dim iCtr As Long
Dim myStartDate As Date

myStartDate = Application.InputBox(Prompt:="Please Enter a start date", _
Default:=Format(Date - Day(Date) + 1, "mmmm dd, yyyy"), _
Type:=1)

If Year(myStartDate) < 2006 Then
Exit Sub
End If

For iCtr = DateSerial(Year(myStartDate), Month(myStartDate), 1) _
To DateSerial(Year(myStartDate), Month(myStartDate) + 1, 0)
Worksheets.Add.Name = Format(iCtr, "dd.mm.yy")
Next iCtr
End Sub
 
S

SteveW

jfk posted in at least 3 forums and got *duplicate* and replies in all 3:)

If only the news servers where connected in real time :)

Steve
 
D

Dave Peterson

Or if jkf would have crossposted one message to all the newsgroups that he/she
wanted--instead of multiposting separate messages to each.
 
J

jkf

thank you for your replies all worked to what i wanted.
and i am sorry for cross posting ,but as i opened my request i was not sure
if it was the right place to ask such a question.

but once again thank you
 
G

Gord Dibben

You did not cross-post.......you multi-posted.

There is a big difference.

With cross-posting those of us with news readers can get the cross-posts
flagged.

Multi-posts cannot be flagged.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top