A checkbox or a button? Does this span over a range? Is this checkbox to loop through each worker?
Assuming Name is in Column A, Regular Hours is in column B, and overtime hours is in column C:
************************************************** ****************************
Private Sub CheckBox1_Click()
'Checks for overtime and adds it to the normal hours column then zeros it out
Dim iRowOn As Long
iRowOn = 2 'The row of the first name, assuming 1 header row
Do While Cells(iRowOn, 1).value <> ""
Cells(iRowOn, 2).Value = Val(Cells(iRowOn, 2).Value) + Val(Cells(iRowOn, 3).Value)
Cells(iRowOn, 3).Value = 0
iRowOn = iRowOn + 1
Loop
End Sub
************************************************** ****************************
|