Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Pause code, wait for input, no input received, carry on with the code

I am trying to schedule reports to rn in excel using the open event,
but obviously might need to change the code, so when I run it I want it
to pop a box and ask if it should run and give me 10-20 seconds to
click no so I can amend the code.

The idea is the workbook opens, pops a box asking if its OK to run with
a count down preferably, run the code if it receives no input.

I know about mode/modeless userforms and have tried using the "wait"
command, but that doesnt let you stop the code using the button.

Is there a do loop or a for next I can use and update a label on a form
to tell me how long I have. Quite new to this.

Any ideas gratefully received.

Thanks john

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Pause code, wait for input, no input received, carry on with the code

Figured it out, just in case someone else needs it.

Sub testwait()

UserForm1.Show vbModeless

TimedDelay 9

MsgBox "wait over"

End Sub


Sub TimedDelay(sec As Single)
Dim x As long
x = Timer + sec

Do While Timer < x
nSec = Round(x - Timer, 0)
UserForm1.Label3 = nSec
DoEvents
Loop
End Sub

Thanks John

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Input Box Question with Code Tom Ogilvy Excel Programming 0 August 16th 04 07:34 PM
Input Box Code Please Help!! Struggling Hard!! Excel Programming 3 July 30th 04 12:29 AM
Code for Input Box Laura C Excel Programming 4 June 29th 04 05:27 PM
pause for input during macro rmills Excel Programming 1 January 29th 04 05:24 AM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 09:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"