Automated Rotating Overtime Rosta

bazza778

New Member
Joined
Mar 4, 2011
Messages
1
Hi Everyone, im a newbie at excel and would really appreciate your help with a Overtime rosta im creating, thanks.

Im trying to create an overtime rosta at work that will drop a name on the overtime list to the bottom of the list at the end of the day the overtime was worked. see below...

Name Date Job Accepted
Joe 14 Mar SST Yes
Steve 16 March SMD Yes
Matt 17 March NN Yes
John 20 March ST yes

So what I need is for the name Joe to drop to the position under the name John at around 11:59:pm on the 14th March, is this in any way possible

Thanks again

Barry
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
You could try something like...

Code:
Sub overtime()
Dim j, k As Integer
Dim i

    i = ActiveCell.Value
    j = Selection.CurrentRegion.Rows.Count
    
    For k = 1 To j - 1
        If ActiveCell.Offset(0, 1).Value = Date Then
            ActiveCell.EntireRow.Copy Destination:=Range("A" & j + 1)
            ActiveCell.EntireRow.Delete
        End If
    Next k

End Sub

This assumes your data starts in column A and that it is in the format presented above. Obviously adjust as necessary. To get the sheet to automatically calculate it at 23:59 use

Code:
Private Sub Workbook_Open()
     Application.OnTime TimeValue("23:59:00"), "overtime"
End Sub

again adjust as per your needs. Although remember, if you are setting it for the next day, you need to change = Date to < Date

HTH
 
Upvote 0

Forum statistics

Threads
1,224,581
Messages
6,179,668
Members
452,936
Latest member
anamikabhargaw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top