Clock in and out 2 breaks and a lunch

Aiden Jenner

New Member
Joined
Sep 30, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hello all,
Please can i get some advice on this: I am trying to create/modify a previous answer by Micron (thank you)

Basically i am trying to create a spreadsheet that records 3 breaks and is for todays date and based 40 colleagues.
The current one has 2 breaks and goes to the next available cell.

I have taken Micron's work and amended it a little to create this so that it works on the activesheet:

Please advise - thank you


Sub FindEmptyInRange()
Dim ws As Worksheet, rng As Range
Dim Lrow As Long

Set ws = ActiveSheet
'not guaranteed but asssume last row will have a value in column A
Lrow = ws.Cells(ws.Rows.Count, "C").End(xlUp).Row
Set rng = ws.Cells.Find("", After:=Range("C" & Lrow), LookAt:=xlPart, LookIn:=xlFormulas, _
SearchOrder:=xlByRows, SearchDirection:=xlNext)
If rng.Column <= 7 And rng.Column >= 3 Then
rng = Time
Else
ws.Range("C" & rng.Row + 1) = Time
End If

Set rng = Nothing
Set ws = Nothing

End Sub
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,223,880
Messages
6,175,153
Members
452,615
Latest member
bogeys2birdies

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