• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 352
  • Last Modified:

Excel Search form/macro

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
compcreate
Asked:
compcreate
  • 4
  • 2
1 Solution
 
redmondbCommented:
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
 
compcreateAuthor Commented:
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
 
redmondbCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
compcreateAuthor Commented:
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
 
redmondbCommented:
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
 
redmondbCommented:
Thanks, compcreate.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with 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.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now