+ Reply to Thread
Results 1 to 52 of 52

Change Roster values

Hybrid View

  1. #1
    Registered User
    Join Date
    03-10-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Change Roster values

    Hi Guru jaslake

    It all make sense to me except for the cleaning roster part. I played around with it, adding columns adjusting it accordingly but no luck. Can you help me adjust cleaning roster sheet to have the following headers:

    Date / Start / Finish/ Location / Employee / Employee / Yes or No / Shift / Posted Roster

                Case "CleaningRoster"
    
                    'CleaningRoster follows the same logic as above but the Heading Layout
                    'is different so requires different handling.  If it does not make sense
                    'let me know
                   Set rng = .Range("A3:A" & LR)
                    For Each cel In rng
                        If cel.Offset(0, 4).Value <> "X" Then
                            sYear = Year(cel.Offset(0, 2).Value)
                            sMonth = WorksheetFunction.Text(cel.Offset(0, 2).Text, "mmm")
                            With ws1
                                Set myRng = .Range(sMonth & "_" & sYear)
                                myName = cel.Value
                                myName2 = cel.Offset(0, 1).Value
                                myDate = Format(cel.Offset(0, 2).Value, "dd/mm/yy")
                                Set myCol = myRng.Rows(1).Find _
                                        (what:=DateValue(myDate), LookIn:=xlFormulas)
    
                                On Error Resume Next
                                Set myRow = .Columns(1).Find(what:=myName, After:=.Cells(myRng.Rows(1).Row, 1), LookIn:=xlValues, LookAt:= _
                                        xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
                                        , SearchFormat:=False)
                                On Error GoTo 0
    
                                On Error Resume Next
                                Set myRow2 = .Columns(1).Find(what:=myName2, After:=.Cells(myRng.Rows(1).Row, 1), LookIn:=xlValues, LookAt:= _
                                        xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
                                        , SearchFormat:=False)
                                On Error GoTo 0
                                Intersect(myRow.EntireRow, myCol.EntireColumn) = cel.Offset(0, 3).Value
                                On Error Resume Next
                                Intersect(myRow2.EntireRow, myCol.EntireColumn) = cel.Offset(0, 3).Value
                                On Error GoTo 0
                                cel.Offset(0, 4).Value = "X"
                            End With
                        End If
                    Next cel
                End Select
            End With
        Next vWks
    End Sub
    Secondly, I was checking the OTSummary sheet code, the "reason" column adds it to the roster. This is not correct because then 2 employees will be OT when suppose to be one. The employee that works the OT is in 1-2 column.
    Last edited by Bloodywog; 04-14-2012 at 10:39 AM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Change Roster values

    Hi Bloodywog
    Sorry...didn't get an email on your edited post #37. One apparently does NOT get notifications on edits. Are Start and Finish times of the day?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Change Roster values

    Hi Bloodywog
    The code in the attached has been modified for this in Cleaning Roster
    Date / Start / Finish/ Location / Employee / Employee / Yes or No / Shift / Posted Roster
    and this in Overtime
    The employee that works the OT is in 1-2 column.
    I ran the procedures several times and all appears well to me. As before, you'll need to modify Date Formats as required. Let me know of issues.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1