Pick time from cell

K

Kash

I have the below code.. can make the time pick from a cell?
Sheets("Set").Range("A8")

Application.OnTime TimeValue("22:50:00"), "cls"
 
R

Rick Rothstein

Try it this way...

Application.OnTime TimeValue(Sheets("Set").Range("A8")), "cls"
 
J

jamescox

Rick -

What format did you use for the time in Cell A8 to get this to work?

Application.OnTime TimeValue(Sheets("Set").Range("A8")), "cls"

I've not been able to puzzle one out for A8 that didn't throw a Run
Time Error 13 - Type Mismatch when the line above tried to execute.

One thing that did work for me was to put in A8 the cell formula

=TIMEVALUE("17:12:50")

and then change the VBA code to

Application.OnTime Sheets("Set").Range("A8"), "cls"

jamescox
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top