Solved

Excel Search form/macro

Posted on 2013-01-16
6
341 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
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…

932 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

11 Experts available now in Live!

Get 1:1 Help Now