problem with picking up 0 with coding

keeegs

Board Regular
Joined
Sep 25, 2011
Messages
145
Hi All

We use 6 digit item codes and alot of our searchs etc are based on these.
Current im using the code below to search for the code and bring up a form. It picks up all entries that don't have a 0 in front of them
How can I get it to pick them up aswell?

Thanks, Keegan


Sub Editform()
Dim name As String

name = Application.InputBox( _
Prompt:="Enter Item Number", _
Title:="Item Number Look Up:", Type:=3)

Range("a4").Select

Do

If (ActiveCell) = name Then

frmEditSpec.Show

Exit Sub

Else: ActiveCell.Offset(1, 0).Select

If IsEmpty(ActiveCell) = True Then

MsgBox ("No Entry with this Item Number")

Exit Sub

End If

End If

Loop

End Sub
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hi Rick.

Is that in the properties box?
Which 1 do I chance because I'm not sure.

I'm using excel 2003 if that helps

Keegan
 
Upvote 0
Is that in the properties box?
Which 1 do I chance because I'm not sure.
I meant change it in the code you posted, this line of code in particular...

Code:
name = Application.InputBox( _
Prompt:="Enter Item Number", _
Title:="Item Number Look Up:", Type:=3)

Change the Type:=3 part ot Type:=2 instead.
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top