Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88835

Allocating the timevalue from a cell entry

$
0
0

I am trying to make sub's in vba to repeat a process processC after some time as designated in the Cell K8 = 00:10:00 (text format).

Dim RunTimer As Date

Sub repeatA()
    'RunTimer = Now + TimeValue("00:10:00")
    RunTimer = Now + TimeValue(K8)
    Application.OnTime RunTimer, "repeatB"
End Sub

Sub repeatB()
    call processC
    call repeatA
End Sub

Sub processC()
    ...
End Sub

It works fine when I use RunTimer = Now + TimeValue("00:10:00"), but when I tried as above I got below error message. I want to assign "00:10:00" from a cell K8 entry. enter image description here


Viewing all articles
Browse latest Browse all 88835


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>