Computing.Net > Forums > Office Software > searchd result 2 display price Exce

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

searchd result 2 display price Exce

Reply to Message Icon

Name: garfield
Date: November 26, 2007 at 21:06:54 Pacific
OS: Win XP
CPU/Ram: intel
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.




Response Number 1
Name: DerbyDad03
Date: November 27, 2007 at 10:44:31 Pacific
+1
Reply:

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 Price

In 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.



Response Number 2
Name: DerbyDad03
Date: November 27, 2007 at 14:59:00 Pacific
+1
Reply:

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



Reply to Message Icon

Related Posts

See More


Adobe Reader error 1311 Excel attachments won't o...



Post Locked

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


Go to Office Software Forum Home


Google Ads



Results for: searchd result 2 display price Exce

converting my time on a timecard www.computing.net/answers/office/converting-my-time-on-a-timecard/9599.html

excel timer function www.computing.net/answers/office/excel-timer-function/91.html

Outlook 2003 Searches www.computing.net/answers/office/outlook-2003-searches/5830.html