Hello,
I have this procedu
iMatch = Application.Match(908, Range(quot;A:Aquot;), 0)
I need help to include an Inputbox that would prompt the user to enter quot;908quot;.
The inputbox msg should read quot; Customer numberquot;
--
Regards,
JeffDim ans
Dim fValid As Boolean
fValid = False
Do
ans = InputBox(quot;Input Customer Numberquot;)
If ans = quot;quot; Then
Exit Sub
Else
If IsNumeric(ans) Then
If ans gt; 0 Then
fValid = True
iMatch = Application.Match(ans, Range(quot;A:Aquot;), 0)
'more code
End If
End If
End If
Loop Until fValid
--
HTH
Bob Phillips
(remove nothere from email address if mailing direct)
quot;Jeffquot; gt; wrote in message
...
gt; Hello,
gt;
gt; I have this procedu
gt; iMatch = Application.Match(908, Range(quot;A:Aquot;), 0)
gt; I need help to include an Inputbox that would prompt the user to enter
quot;908quot;.
gt; The inputbox msg should read quot; Customer numberquot;
gt; --
gt; Regards,
gt; Jeff
gt;
dim CustNumber as long
dim iMatch as variant
custNumber = application.inputbox(prompt:=quot;Customer Numberquot;,type:=1)
if custnumber = 0 then
exit sub
end if
imatch = Application.Match(custnumber, Range(quot;A:Aquot;), 0)
if iserror(imatch) then
'not found
else
'found
end if
application.inputbox with type:=1 forces the user to enter numbers.Jeff wrote:
gt;
gt; Hello,
gt;
gt; I have this procedu
gt; iMatch = Application.Match(908, Range(quot;A:Aquot;), 0)
gt; I need help to include an Inputbox that would prompt the user to enter quot;908quot;.
gt; The inputbox msg should read quot; Customer numberquot;
gt; --
gt; Regards,
gt; Jeff
--
Dave Peterson
I think this:
iMatch = Application.Match(ans, Range(quot;A:Aquot;), 0)
needs to be:
iMatch = Application.Match(clng(ans), Range(quot;A:Aquot;), 0)
if that table is really numbers.Bob Phillips wrote:
gt;
gt; Dim ans
gt; Dim fValid As Boolean
gt;
gt; fValid = False
gt; Do
gt; ans = InputBox(quot;Input Customer Numberquot;)
gt; If ans = quot;quot; Then
gt; Exit Sub
gt; Else
gt; If IsNumeric(ans) Then
gt; If ans gt; 0 Then
gt; fValid = True
gt; iMatch = Application.Match(ans, Range(quot;A:Aquot;), 0)
gt; 'more code
gt; End If
gt; End If
gt; End If
gt; Loop Until fValid
gt;
gt; --
gt; HTH
gt;
gt; Bob Phillips
gt;
gt; (remove nothere from email address if mailing direct)
gt;
gt; quot;Jeffquot; gt; wrote in message
gt; ...
gt; gt; Hello,
gt; gt;
gt; gt; I have this procedu
gt; gt; iMatch = Application.Match(908, Range(quot;A:Aquot;), 0)
gt; gt; I need help to include an Inputbox that would prompt the user to enter
gt; quot;908quot;.
gt; gt; The inputbox msg should read quot; Customer numberquot;
gt; gt; --
gt; gt; Regards,
gt; gt; Jeff
gt; gt;
--
Dave Peterson
- Apr 13 Sun 2008 20:43
Inputbox with VBA
close
全站熱搜
留言列表
發表留言