Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
WA WA is offline
external usenet poster
 
Posts: 37
Default Execute VB code depending on time of day

Hi,

I have the clock (24 format) in a spreadsheet. When a user clicks a button,
I would like to see the procedure executed only if it is after a certain
time. ie. if it is after 17:00, then the function will run, otherwise a msg
will state that it is too early.

I've looked at the OnTime code, but it will not serve my purpose.
Any ideas would be greatly appreciated.

Thanks,

WA
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Execute VB code depending on time of day

My preference for that kind of thing would be to use the ontime method. When
the spreadsheet is opened check the time and if it is after 17:00 then enable
the button otherwise disable. Have the on time method enable the button at
17:00. That code is very lightweight. The nice thing about it is that the
user can only click the button when it is valid to do so. No need for a
message box telling the user that they can not do something that you never
intended to let them complete.
--
HTH...

Jim Thomlinson


"WA" wrote:

Hi,

I have the clock (24 format) in a spreadsheet. When a user clicks a button,
I would like to see the procedure executed only if it is after a certain
time. ie. if it is after 17:00, then the function will run, otherwise a msg
will state that it is too early.

I've looked at the OnTime code, but it will not serve my purpose.
Any ideas would be greatly appreciated.

Thanks,

WA

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fomula which returns the amount depending on the currency code Narnimar Excel Discussion (Misc queries) 3 November 23rd 08 12:50 PM
Execute vba code on cell exit Bill (Unique as my name) Excel Discussion (Misc queries) 2 May 24th 07 03:48 PM
is there a way to schedule a macro to execute at a certain time? Colibri_2 Excel Discussion (Misc queries) 4 February 13th 07 09:00 PM
can i execute a calculation in a cell at a certain time of the day terry Excel Worksheet Functions 2 June 9th 06 04:03 PM
how do you execute single line of code? honestlylion Excel Discussion (Misc queries) 2 February 24th 06 03:35 PM


All times are GMT +1. The time now is 12:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"