ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Time function in Excel (https://www.excelbanter.com/excel-programming/304385-time-function-excel.html)

Ian M[_2_]

Time function in Excel
 
How can I programme an individual cell in an Excel spreadsheet to
perform a task depending on what time is entered into it.

i.e. if any time is entered which falls between 12.00 noon and 1.30
pm, I want a message box to appear saying "Remember to Order Lunch".

Any ideas?

Thanks for your help.

Kind regards

Paddymichelle

Tom Ogilvy

Time function in Excel
 
if time = TimeValue("12:00 PM") or time <= TimeValue("1:00 PM") then

--
Regards,
Tom Ogilvy

"Ian M" wrote in message
om...
How can I programme an individual cell in an Excel spreadsheet to
perform a task depending on what time is entered into it.

i.e. if any time is entered which falls between 12.00 noon and 1.30
pm, I want a message box to appear saying "Remember to Order Lunch".

Any ideas?

Thanks for your help.

Kind regards

Paddymichelle




Damien McBain

Time function in Excel
 
Tom Ogilvy wrote:
if time = TimeValue("12:00 PM") or time <= TimeValue("1:00 PM") then


should be "and" not "or"?

Damo




All times are GMT +1. The time now is 11:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com