Solved

Excel Search form/macro

Posted on 2013-01-16
6
346 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

679 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