PDA

View Full Version : An Excel Project!



Sir Phoenix
10-17-2005, 08:10 PM
Alright... what I've made so far has been with the copious assistance of the members of this forum. So I share it with you all, and if you want to take all or part of it, feel free. There are two userforms on the final pages. One will allow you to create/change/delete employees for 3 different shifts. The other will allow you to make schedules for all 7 days of the week for different shifts.

Now... I need help with the next part, it's going to be a doozy. I want an area where people type how many months to schedule (max months is month(now())-December of next year)... then push a button. The button will make a new tab for each month (that isn't already created), tab named for the month and year. Then, for each week in the month, it lists all people, and gives them one schedule based on their personal shift, (evening workers get evening shifts, daytime get daytime). the next week, the shifts rotate. Keep repeating for all weeks through all months that was selected.

I don't even know where to begin for this... so... anyone interested in working with me on it? Reply here, or... hit me on aim 'phnx88'.

Thanks for any/all takers!

NashProjects
12-23-2011, 02:00 AM
would be helpful if you could post a screen shot or something so we have something to workwith

to automatically create another sheet the code is

Sheets.Add after:=Sheets(SheetnameYouwantTheNewSheetAfter)
activesheet.name = "Dec-11" 'Names the new sheet

Bob Phillips
12-23-2011, 03:33 AM
Asusming the date is input onton a textbox on a form, use



Private Sub CommandButton1_Click()
Dim ws As Worksheet
Dim endDate As Date
Dim shName As String
Dim i As Long

With Me

If IsDate(.TextBox1.Text) Then

endDate = CDate(TextBox1.Text)
For i = 0 To DateDiff("m", Date, endDate)

Set ws = Nothing
On Error Resume Next
shName = Format(DateSerial(Year(Date), Month(Date) + i, 1), "mmm-yy")
Set ws = ThisWorkbook.Worksheets(shName)
On Error GoTo 0
If ws Is Nothing Then

Set ws = ThisWorkbook.Worksheets.Add(After:=ThisWorkbook.Worksheets(ThisWorkbook.Wor ksheets.Count))
ws.Name = shName
End If
Next i
End If
End With
End Sub

Sir Phoenix
12-23-2011, 06:17 AM
Woah! Talk about resurrecting the dead. :)

This is a long forgotten project for a long forgotten job. I appreciate the help after all these years, there is just no need at the moment. Thank you anyways!

mancubus
12-23-2011, 06:49 AM
Woah! Talk about resurrecting the dead. :)

This is a long forgotten project for a long forgotten job. I appreciate the help after all these years, there is just no need at the moment. Thank you anyways!


6 years and 2 months.
:whistle:

Bob Phillips
12-23-2011, 09:29 AM
LOL! I hadn't noticed. It popped up again because NashProjects replied. Seems he is going through all of the unanswered threads.