View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Auric__ Auric__ is offline
external usenet poster
 
Posts: 538
Default Variables in a Popup prompt

Howard wrote:

Msgbox below works fine, returns a capital letter for j and an ASCII
char for i.


I assume that's supposed to be "ASCII value".

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


Let's look at those, first...

"j & " for " & i"
string + keyword + string = syntax error

j & " for " & i
variable + string + variable = *should* be working

Indeed, this works for me:

j = "A"
i = 65
CreateObject("WScript.Shell").Popup j & " for " & i, 2, "ASCII Select"

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)


You might try explicitly assigning the two variables to a string:

Dim tmp As String
tmp = j & " for " & i
CreateObject("WScript.Shell").Popup tmp, 2, "ASCII Select"

--
Revenge! I'm screaming revenge again!