Consulting

Results 1 to 6 of 6

Thread: An Excel Project!

  1. #1

    An Excel Project!

    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!

  2. #2
    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
    Kind regards

    Lee Nash

    http://www.NashProjects.com


  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Asusming the date is input onton a textbox on a form, use

    [vba]

    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
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  4. #4
    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!

  5. #5
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    Quote Originally Posted by Sir Phoenix
    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.
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    LOL! I hadn't noticed. It popped up again because NashProjects replied. Seems he is going through all of the unanswered threads.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •