Solved

Excel Search form/macro

Posted on 2013-01-16
6
340 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

757 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

19 Experts available now in Live!

Get 1:1 Help Now