Hi Riz,
Try this:
Sub RizCounter(): Dim CI As Date, CO As Date, ET As Date, r As Long, c As Long
For c = 1 To Columns.Find("*", , , , xlByColumns, xlPrevious).Column Step 4
For r = 2 To Columns(c).Find("*", , , , xlByRows, xlPrevious).Row
If InStr(1, Cells(r, c), "Clock") Then
CO = Cells(r, c + 2): CI = Cells(r, c + 1)
CO = CDate(Trim(Replace(CStr(CO), "1/1/1904", "")))
CI = CDate(Trim(Replace(CStr(CI), "1/1/1904", "")))
ET = CO - CI
Cells(r - 3, c + 1).Resize(2, 1).NumberFormat = "h:mm"
Cells(r - 3, c + 1).Resize(2, 1).Value = ET
End If: Next r: Next c
End Sub
Bookmarks