excel - Macro to start at a particular time -
i have found sources use
application.ontime timevalue("18:00:00"), "mymacro"
but can't seem work. have entered
sub timestamp() ' ' timestamp macro ' ' keyboard shortcut: ctrl+shift+t ' application.ontime timevalue("13:25:00"), "timestamp" ' following refreshes data application.calculatefullrebuild
then rest of code followed end sub
for whatever unknown reason, when start macro, not wait until given time. syntax rules breaking here?
the macro triggered when macro triggered. ontime schedules run automatically, why should prevent running manually? think of virus scan. many people have computers configured automatic scans @ set times, able run nonscheduled scans @ time. if want make sure macro doesn't have effect before time, use if - statement involving (if exit sub) -- although makes more sense not run @ when don't want to.
Comments
Post a Comment