Instruction Delay

  • Thread starter Thread starter Craig Coope
  • Start date Start date
C

Craig Coope

IS it possible to program a button to do something simple, such as
input a "1" into cell A1 but 10 seconds after the button is pressed.

I'm looking for something like:

Private Sub CommandButton1_Click()
"10 seconds timer" (and then)
Range("a1") = 1
end sub

Cheers,

Craig
 
Experiment with

For j=1 to 10000
' do nothing
Next j

Try bigger/smaller values for 10000. But be aware the delay will not be the
same on all machines.
best wishes
 
Or maybe:

application.wait now + timeserial(0,0,10)

The program just sits there and does nothing for 10 seconds.
 

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

Back
Top