Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Howard wrote:
On Monday, February 11, 2013 1:19:13 AM UTC-8, Howard wrote: Msgbox below works fine, returns a capital letter for j and an ASCII char for i. The timed Popup works fine with prompt shown, want another timed Popup to display what the message box does and do away with the msgbox. i and j are declared variable refering to two cells on the worksheet. Possible? I have tried to put the j and the i in the prompt section of this timed popup but it rejects .Popup "j & " for " & i" as well as .Popup j & " for " & i MsgBox j & " for " & i CreateObject("WScript.Shell").Popup "Select another Capital Letter in K1 to convert to ASCII", _ 2, "ASCII Select" (The CreateObject... text will probably wrap) Thanks for the advice. I'm getting in a bit above my head on scripting objects and at the same time I'm finding the msgbox and the timed popup don't seem to add a great deal of value to the process. I'll most likely dump them. I do appreciate you time and thoughts. No prob. One last thought.. If you really want the timed msgbox, you could easily make your own. Create a form with a label and an OK button, and add this code to the form: Public x As Single Private Sub CommandButton1_Click() Unload Me End Sub Private Sub UserForm_Activate() x = Timer Do DoEvents If Timer (x + 2!) Then Unload Me: Exit Sub Loop End Sub Private Sub UserForm_Initialize() Label1.Caption = some_public_variable End Sub The message would have to come from a public variable set by your code (which I've called "some_public_variable" here). You'd use this like so: Public some_public_variable As String Sub foo() j = "A" i = 65 some_public_variable = j & " for " & i UserForm1.Show While UserForm1.Visible DoEvents Wend End Sub The downside of this is that the CPU usage will spike to 100% for those 2 seconds. (DoEvents will allow other things to happen so the machine doesn't just lock completely up, but still.) There are other ways of doing this (see Application.Wait, for example), but you'll need to experiment to see if you like any of them. (A regular VB timer control would solve all these problems, but I can't see how to add one to the VBA form.) -- You're complaining about grammar in spam? Don't you have anything better to do? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Satisfying two variables entered via popup | Excel Discussion (Misc queries) | |||
How to use two parameters in input of popup Variables - Gary's Student | Excel Worksheet Functions | |||
Prompt for tab name and then prompt for number of iterations of ta | Excel Programming | |||
variables in footers; how to prompt user for input within macro | Excel Programming | |||
Entering variables on Msgbox prompt | Excel Programming |