Clear contents

Aidan

Board Regular
Joined
May 14, 2004
Messages
121
Hi all,

I haven't been on for a while (and have forgotten all I have learned from this site) primarily because I haven't been using excel much in my work.

However I have been asked a question by a colleague and need a bit of help in answering it.

My colleague has devised a timesheet with the following columns

Column a = date
column b = da
column c = time in
column d = lunch start
column e = lunch end
column f = time out
column g = hours worked

Basically he is looking for a macro that will check that lunch start is greater than time in, if not then a message box appears saying wrong value and deletes the value in lunch start column.

I have had a quick search of the site but can't find anything that relevant. Your help, as always, would be much appreciated.

Regards


Aidan :biggrin:
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi Aidan

Just a thought, but wouldn't data validation be a better idea than a macro? It would be a lot simpler.

Richard
 
Upvote 0
Hi Richard,

thanks for that. As I said I don't use excel much now and if you don't use it you forget it quite quickly.

Another point about data validation. lunch start and lunch end must be greater than 30 mins. I have tried greater than d9+30 but doesn't like any of that.

Any ideas


Aidan
 
Upvote 0
Aidan

Validation Criteria:
1. Allow - "Time"
2. Data - "Greater Than"
3. Start Time - "=d9+30/1440"

works for me. 30/1440 is the portion of a whole day that 30 minutes represents.

Best regards

Richard
 
Upvote 0

Forum statistics

Threads
1,214,789
Messages
6,121,605
Members
449,038
Latest member
Arbind kumar

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