Tom's Guide | Tom's Hardware | Tom's Games | PC Safety Suite
![]() |
![]() |
![]() |
Comment:
If i have four columns in excel: speed no,model,description, unit price
How can i make a simple tool such that when I searched for specific model or speed no, the result will display the unit amout instead.
I don't know any vba only the basics.thanks.
+1 | ![]() |
If you are willing to settle for 2 data entry points, one for Speed No and one for Model, VLOOKUP() would be pretty simple
Let's say your data is set up as follows:
A1:A25 - Speed No
B1:B25 - Model
C1:C25 - Description
D1:D25 - Unit PriceIn E1 enter the text "Speed No"
Leave E2 empty
In E3 enter =VLOOKUP(E2,A1:D25,4,FALSE)When you enter a Speed No in E2, E3 will show the Unit Price.
In F1 enter the text "Model"
Leave F2 empty
In F3 enter =VLOOKUP(F2,B1:D25,3,FALSE)When you enter a Model in F2, F3 will show the Unit Price.
+1 | ![]() |
And here's some simple code that will return the price if you enter a Speed No or a Model.
It assumes your data is set up the same as described in my earlier post.
There's no error checking or fancy features..it's just to show you what could be done.
Sub ShowPrice()
MyThing = Application.InputBox("Enter Speed No or Model")
With Worksheets(1).Range("A1:B25")
Set c = .Find(MyThing, lookat:=xlWhole, LookIn:=xlValues)
If Not c Is Nothing Then
If c.Column = 1 Then _
MsgBox c.Offset(0, 3) _
Else MsgBox c.Offset(0, 2)
End If
End With
End Sub
![]() |
Adobe Reader error 1311
|
Excel attachments won't o...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.