Hello,
I have this procedure:
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
Hello,
I have this procedure:
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
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" <[email protected]> wrote in message
news:[email protected]...
> Hello,
>
> I have this procedure:
> 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
>
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 procedure:
> 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
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" <[email protected]> wrote in message
> news:[email protected]...
> > Hello,
> >
> > I have this procedure:
> > 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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks