ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pick time from cell (https://www.excelbanter.com/excel-programming/430466-pick-time-cell.html)

Kash

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

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

Rick Rothstein

Pick time from cell
 
Try it this way...

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

--
Rick (MVP - Excel)


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

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



jamescox[_80_]

Pick time from cell
 


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


--
jamescox
------------------------------------------------------------------------
jamescox's Profile: http://www.thecodecage.com/forumz/member.php?userid=449
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=110860



All times are GMT +1. The time now is 02:40 AM.

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