Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Inputbox with VBA
Hello,
I have this procedu iMatch = Application.Match(908, Range("A:A"), 0) I need help to include an Inputbox that would prompt the user to enter "908". The inputbox msg should read " Customer number" -- Regards, Jeff |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Inputbox with VBA
Dim ans
Dim fValid As Boolean fValid = False Do ans = InputBox("Input Customer Number") If ans = "" Then Exit Sub Else If IsNumeric(ans) Then If ans 0 Then fValid = True iMatch = Application.Match(ans, Range("A:A"), 0) 'more code End If End If End If Loop Until fValid -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Jeff" wrote in message ... Hello, I have this procedu iMatch = Application.Match(908, Range("A:A"), 0) I need help to include an Inputbox that would prompt the user to enter "908". The inputbox msg should read " Customer number" -- Regards, Jeff |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Inputbox with VBA
dim CustNumber as long
dim iMatch as variant custNumber = application.inputbox(prompt:="Customer Number",type:=1) if custnumber = 0 then exit sub end if imatch = Application.Match(custnumber, Range("A:A"), 0) if iserror(imatch) then 'not found else 'found end if application.inputbox with type:=1 forces the user to enter numbers. Jeff wrote: Hello, I have this procedu iMatch = Application.Match(908, Range("A:A"), 0) I need help to include an Inputbox that would prompt the user to enter "908". The inputbox msg should read " Customer number" -- Regards, Jeff -- Dave Peterson |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Inputbox with VBA
I think this:
iMatch = Application.Match(ans, Range("A:A"), 0) needs to be: iMatch = Application.Match(clng(ans), Range("A:A"), 0) if that table is really numbers. Bob Phillips wrote: Dim ans Dim fValid As Boolean fValid = False Do ans = InputBox("Input Customer Number") If ans = "" Then Exit Sub Else If IsNumeric(ans) Then If ans 0 Then fValid = True iMatch = Application.Match(ans, Range("A:A"), 0) 'more code End If End If End If Loop Until fValid -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Jeff" wrote in message ... Hello, I have this procedu iMatch = Application.Match(908, Range("A:A"), 0) I need help to include an Inputbox that would prompt the user to enter "908". The inputbox msg should read " Customer number" -- Regards, Jeff -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can Text in an InputBox appear as asterisks? | Excel Discussion (Misc queries) | |||
Compile Error in Excel 2004 when Inputbox contains "VBCRLF" | Excel Discussion (Misc queries) | |||
Excel Inputbox | Excel Discussion (Misc queries) | |||
Checkmark instead of InputBox | Excel Discussion (Misc queries) | |||
Inputbox with Listbox | Excel Discussion (Misc queries) |