View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ivan F Moala[_43_] Ivan F Moala[_43_] is offline
external usenet poster
 
Posts: 1
Default User Input Of A Number


Chuckles123 Wrote:
Looking for guidance on constructing code to pause macro and have use
input a 2- or 3-digit number, and then macro continuing. Also, i
would be useful for macro, after results are displayed in spreadsheet
to loop back to input option.
Thanks in advance.
Chuckles123


Hi Chuckles123

What you need to use is the Application.Inputbox function.

Have a look in your help files .....

example something like this

Sub Tester()
Dim Result

Again:
Result = Application.InputBox("Enter 2 or 3 didgit number", Type:=1)
If Result = False Then Exit Sub
If Len(Result) 3 Or Len(Result) < 2 Then GoTo Again

MsgBox Result

End Su

--
Ivan F Moal

-----------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...nfo&userid=195
View this thread: http://www.excelforum.com/showthread.php?threadid=27517