Solved

Excel Search form/macro

Posted on 2013-01-16
6
342 Views
Last Modified: 2013-01-20
Hello,
  I have an excel inventory spreadsheet that is used heavily and I would like some advanced search functions.  Ideally I would like a separate sheet or form that is very basic so the user doesnt get confused.

  Here is an example of the spreadsheet layout:

Item#, Qty truck 1, Qty truck 2, Qty truck 3, cost, etc...
1234, 3, 2, 4, $5, etc...

  The normal search function allows us to search by part number and see the entire row, of course.  But the row has 50 columns and we dont need to see all that data.  I would like to have a simple search form that allows us to put in the item number and perhaps a truck number.  So then I am returned only the qty of that item in that location and if the item is not present in that location a message stating so.

 For example, if I put in my criteria item 1234, truck 3, I want to see the item returned and that there is 4 available in that truck.  

  Maybe it would be easier to search by item # but then select the other columns that I want returned in the results.  Maybe I want to see what trucks have it and the reorder points etc..

  I hope im being clear in what im requesting.  Let me know if you have questions. Thanks in advance for any help.
0
Comment
Question by:compcreate
  • 4
  • 2
6 Comments
 
LVL 26

Accepted Solution

by:
redmondb earned 400 total points
ID: 38784998
Hi, compcreate.

Option 1 - Data Form
Couple of problem with this is
 - There isn't a strong message when an item isn't found.
 - If the user forgets to hit the Criteria button, it's too easy to accidentally change an Item No.Data-Form.xlsmOption 2 - FormulaFind-Items.xlsxRegards,
Brian.
0
 

Author Comment

by:compcreate
ID: 38787189
How is this being implemented?  I don't see any macros or VBS and I only see a formula in B3.

This might work for me but of course I have to adapt it to our real inventory sheet to test it out.  Thanks for your efforts.
0
 
LVL 26

Expert Comment

by:redmondb
ID: 38787213
compcreate,

Ìn Data-Form.xlsm, click on the blue button to run the Show_Data_Form macro.

In Find-Items.xlsm...
 - Type the Item No, you're searching for in B1
 - Select the Truck No. from the drop-down in B2.
The results are shown in B3. If the Item No, is invalid then B3 shows "N/A". The main work is done by the formula in B3.

Regards,
Brian.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:compcreate
ID: 38787237
OK... the second solution is more like what I am looking for, however can you break down the formula for me please.  

=IFERROR(OFFSET($A$6,MATCH(B1,Items,0),B2),"N/A")
0
 
LVL 26

Expert Comment

by:redmondb
ID: 38787386
compcreate,

Yes, I think it's much the better option!

Working from the inside out...
Items - A Defined Name referring to the range Sheet1!$A$7:$A$33
MATCH(B1,Items,0),B2) - Search "Items" for the Item No. entered in B1, e.g. Item 770 is the 17th entry.
OFFSET($A$6,MATCH(B1,Items,0),B2) - Using the previous line's example, the MATCH is replaced by 17. B2  is the No, of the Truck from the dropdown, say 3. This means that this part of the formula is OFFSET($A$6,17,3). So, the formula return the value 17 rows down and three rows across from A6 - which is 9.
=IFERROR(OFFSET($A$6,MATCH(B1,Items,0),B2),"N/A") - If the MATCH can't find the Item No. then it'll return an error, which will cause OFFSET to return an error and so IFERROR will display "N/A".

Regards,
Brian.
0
 
LVL 26

Expert Comment

by:redmondb
ID: 38799080
Thanks, compcreate.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Quarter Increment Clock 2 15
modify formula same cell multiple times 15 28
Excel lookup tables & values 7 24
conditional formatting 4 41
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now