Hello all I am a brand spankin new member here and need a little help with some vba code. Thanks ahead of time for the help !!
Ok making progress but need a little more guidance, please..
Have vba that copies a certain criteria from Gate Log rounds the total hours worked and then paste the data into the Timesheet
see code below:
Sub Test()
Worksheets("Gate_Log").Range("A2:B300").Copy Worksheets("Timesheet").Range("B2")
Worksheets("Gate_Log").Range("D2:D300").Copy Worksheets("Timesheet").Range("D2")
Worksheets("Gate_Log").Range("E2:E300").Copy Worksheets("Timesheet").Range("L2")
Dim OneCell As Range
For Each OneCell In Range(Range("L2"), Range("L" & Rows.Count).End(xlUp))
OneCell.Formula = "=Round(" & OneCell.Value & ",0)"
Next OneCell
End Sub
what I need is to have the code automatically deduct 30 minutes from the total hours on the gate log and then round it to the nearest hour based on 30 minute scale and then paste that value in column L of Timesheet. Current code works great but is rounding up or down based on .50 scale wrather than .30 ,ie; 30 minutes.
Example:
Gate Log = 7.45 - 30 minutes = 7.15 then rounded = 7.00
any help would be greatly appreciated.
Bookmarks