+ Reply to Thread
Results 1 to 10 of 10

Need a lookup to extract data table based on four criteria & override user input

  1. #1
    Registered User
    Join Date
    03-13-2013
    Location
    Wichita,KS
    MS-Off Ver
    365 Aps for Enterprise
    Posts
    60

    Need a lookup to extract data table based on four criteria & override user input

    I am working on a Quote Template for pricing out hoists.

    1). The user will select from four separate dropdown lists: Reeving, Capacity, Model, & Trolley. Each dropdown list narrows the data for the next dropdown list. However, I want to have a "display table" that shows available hoists as the user is progressing through the dropdown lists. In other words, when the user has selected one ton capacity, he will see a table that shows all one ton hoists and related data those hoists. Then he can select a model and the "display table" will show data for only the selected capacity and model. And so on.... I have set up the dropdown lists but need help with the lookup for the display table. See requests and exampes on attached sheet.

    2). I have a separate sheet that displays technical info and need to extract data from another worksheet. The challenge is that users need be able to override the default formula. However, when the user input is erased, the formulated value should show.

    Details, requests, and examples are shown in the "Quote" and "Calculation" worksheets of the attached workbook.

    Thanks in advance for your help!

  2. #2
    Registered User
    Join Date
    06-22-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: Need a lookup to extract data table based on four criteria & override user input

    Marvelous,

    This one was not easy - it took me half a day. Normally I crack posts on here in less than 30 mins!

    On the calculation sheet I have put in a series of formulas that pulls the correct data based on the drop down selections. This is done using array formulas, finding which rows are appropriate for the relevant criteria and then pulling the data.

    What you will find is that the final selection is at the top of the table. This makes pulling the data through onto the quote tab easy. I do not understand what data you want on the trolley speeds field so I have coloured this red.

    For the rope diameter and equipment net weigh this is just a vlookup on the correct sheet.

    To allow the users to override the data on the quote tab, and then have the formulas pop back if that data is deleted I have put some code in the worksheet change event. So everytime something changes on the quote sheet it checks whether any of the relevant cells are blank. If they are the formulas are put back in.

    Please Login or Register  to view this content.
    Take a look and come back with questions.

    You need to do formal testing to make sure you have what you want before you use with clients - the risk here is yours!

    Regards

    David
    Last edited by JBeaucaire; 08-14-2013 at 10:32 AM.

  3. #3
    Registered User
    Join Date
    03-13-2013
    Location
    Wichita,KS
    MS-Off Ver
    365 Aps for Enterprise
    Posts
    60

    Re: Need a lookup to extract data table based on four criteria & override user input

    David,

    This looks absolutely fantastic! I was concerned that no one would want to take on something this difficult. Initially, I have a couple of questions and requests but will hold off on them untill I test this template. I will have the testing done by tomorrow so I will get back to you again shortly. Thanks again for all your hard work on this!

    Marvin

  4. #4
    Registered User
    Join Date
    03-13-2013
    Location
    Wichita,KS
    MS-Off Ver
    365 Aps for Enterprise
    Posts
    60

    Re: Need a lookup to extract data table based on four criteria & override user input

    David,

    Once again, thank you so much for your help . You are the man! I cannot express how much I am impressed by your ability to put this together. After testing the quote template, I have some requests and questions. All NEW comments are highlighted in blue in the attached file.1). If I go through the Calculation sheet in order it works pretty well. However, if I have already selected the Reeving (C5), Capacity (C6), and Model (C7) but then change the Capacity again...the "Display Table" (G13:O13) is not updated. I have saved the the attached worksheet to show this and included new comments. I am actually using the price shown from the top row of the display table so a client could potentialy not realize that they hadn't changed the model number (after changing the Capacity) and the display table would show the wrong price. The Trolley selection (C8 on the Calculation sheet) works ok because if the user selects a trolley size or type that is not available with the selected Capacity and Model, because a zero is shown. In other words, if only one row is displayed in the "Display Table" then the data displayed needs to be blank (show error?) or match the criteria shown in all cells C5:C8. Hope this makes sense.

    2). On the equipment net weight (quote tab) the lookup is only looking up the "base mount" weight, There are three trolley choices (each trolley type has a different weight) which are based on the user selection in cell C8 on the calculation sheet. You will notice on both "Spec" sheets that there is a "weight" column for "base mount", Monorail, and Double Girder. The Double Girder refers to all of the trolleys that are referenced by sizes such as 49 1/4, 55 1/8, etc...

    3). Is there a way to highlight a cell if it has been overriden? If so, I would like for all cells that have been overriden to be highlighted until the formulated value is shown again. This way we can tell if something is has been changed by a user. Also, it would be nice if all of the cells that were overrided would go back to the formulated value after the quote template has been closed and re-opened.

    4). Last but not least. The VBA change event does not seem to be working. I thought it was working initially but I am not sure if it is something I have done. The cell does not revert back to the formulated value. I changed a reference in a cell on the "Quote" tab so maybe that messed it up? I looked at the debugging option but am not familiar enough with VBA to figure how to get the code back to where it needs to be. I will be locking many of these cells before I send the template out to the client but it would be nice to understand how to get the VBA corrected in case I accidentally do it again.

    Thanks again for your time and expertise!
    Marvin

  5. #5
    Registered User
    Join Date
    06-22-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: Need a lookup to extract data table based on four criteria & override user input

    Marvin,

    I have made the amendments, see attached.

    1) to ensure that noting is displayed if they choose a model and then go back and change the weight I have amended the formula so you in effect get and AND for model and capacity - if these to are not in line then nothing is displayed

    =IFERROR(SMALL(IF($C$5="SingleReeved",IF($C$7<>"",IF(($C$7=Model)*($E$6=Capacity),ROW(Model)),IF($C$6="",ROW(Capacity),IF($E$6=Capacity,ROW(Capacity)))),IF($C$7<>"",IF(($C$7=ModelDR)*($E$6=CapacityDR),ROW(ModelDR)),IF($C$6="",ROW(CapacityDR),IF($E$6=CapacityDR,ROW(CapacityDR))))),ROW(G1)),"")

    2) the formula for the weigh and trolley speed now pulls based on whether Base Mount monorail or other is selected - this is achieved through nested if and vlookups. Check the rope diameter formula as well as I think I changed for some reason

    3) Where cell formulas are overridden the cell then displays in orange viathe Quote worksheet change event, code is below. If the formulas are not as they should be the cells are orange, if they are reset they are coloured green

    Please Login or Register  to view this content.
    I have put some code in the worksheet open event macro to reset the formulas when the workbook is opened, see below

    Please Login or Register  to view this content.
    4) Please retest changes to the Quote worksheet. The changes seem to work for me.

    I have enjoyed working your problem but remember the purpose of forum is to teach concepts and share knowledge rather than get a particular spreadsheet right. If you need that kind of help then we need to operate a different model!

    Regards

    David
    Last edited by JBeaucaire; 08-14-2013 at 10:25 AM.

  6. #6
    Registered User
    Join Date
    03-13-2013
    Location
    Wichita,KS
    MS-Off Ver
    365 Aps for Enterprise
    Posts
    60

    Re: Need a lookup to extract data table based on four criteria & override user input

    David,

    Great job! This is going to work so well. The only thing I need to change is the colors of the cells (with the vba change event code) on the "Quote" tab. Our clients print this out in a pdf format so we would like for it to not be as noticeable. Like maybe a gray shade if it has been changed but nothing if it hasn't.

    I do take your comments seriously and am trying to follow your steps and learn as we go. If you could explain how I can change the VBA (changing color of cells) without messing anything up I will go in and do it myself. I have copied and pasted VBA code before but haven't done any editing so I am not sure what the steps are for doing this. I am trying to learn as much as I can about VBA.

    Since I am so new with VBA, I do have a couple of general questions. This workbook will be sent out to several different clients to use. I noticed when I open the workbook it asks me to enable macros. Is there a way that I and my clients can opt to enable macros for this workbook only? Kind of like the "trusted site" for Internet Explorer. Also, do I need to do anything to protect the code before I send the worksheet out to clients? Can the code be messed up from the sheet level?

    Thanks for your patience and good work!
    Marvin

  7. #7
    Registered User
    Join Date
    06-22-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: Need a lookup to extract data table based on four criteria & override user input

    Marvin,

    A couple of screenshots in the attached workbook show you how to change the RGBs to the colours you want.

    When you open the workbook, assuming you don't have macros enabled, Excel gives you a security warning. You can then enable macros. If you close the spreadsheet when you re-open Excel again gives you the security warning - therefore it seems to me that when you enable the macros on opening a worksheet it is just for that time for that worksheet. It does not change your overall settings.

    I would consult http://office.microsoft.com/ if you want chapter and verse on excel macro security/ trust centres etc. I am not an expert on security!

    Most people do not have the Developer tab enabled so will never see the code anyway. You cannot mess the code up from a worksheet level.

    Regards

    David
    Attached Files Attached Files
    Last edited by JBeaucaire; 08-14-2013 at 10:26 AM.

  8. #8
    Registered User
    Join Date
    03-13-2013
    Location
    Wichita,KS
    MS-Off Ver
    365 Aps for Enterprise
    Posts
    60

    Re: Need a lookup to extract data table based on four criteria & override user input

    David,

    Thank you for explaining how to change the colors in VBA. You have been an invaluable resource and I am so grateful for your help and guidance. Also, I did go to the links below your name and there are some good resources there as well.

    Marvin

  9. #9
    Registered User
    Join Date
    06-22-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: Need a lookup to extract data table based on four criteria & override user input

    Marvin,

    Glad to have been able to help. Please can you click the "add reputation" button for me. Come back to me if you need some help in the future, I will be happy to point you in the right direction. Also, feel free to pass on my name to others you know who may need assistance in Excel matters.

    Regards

    David
    Last edited by JBeaucaire; 08-14-2013 at 10:26 AM.

  10. #10
    Registered User
    Join Date
    03-13-2013
    Location
    Wichita,KS
    MS-Off Ver
    365 Aps for Enterprise
    Posts
    60

    Re: Need a lookup to extract data table based on four criteria & override user input

    David,

    I have "added reputation" a couple of times and will continue to do so because I cannot give you enough kudos for your help on this project. Another question: I have managed to get a couple of errors in the VBA code at different stages which opens the "debugger". Is this occuring because I am trying to add rows or columns? In other words, does the VBA automatically update or does moving rows/columns mess up the VBA code? As in my instance, I may need to add a row on both the "Quote" sheet and the "Calculation" sheet. On the "Calculation" sheet the user will need to add rows quite often and it will be in between Rows 14 & 17 which is the same area that the "display table" is in. Will this cause any problems?

    I know that I am going to have several questions in the future. Should I just post them to the forum or reply to your post? Not exactly sure what proper protocol is for this site.

    Have a good day!
    Marvin

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. copy rows based on 1 criteria + user input + pastevalues (almost there...)
    By Dieneces in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-23-2013, 10:38 AM
  2. [SOLVED] Lookup more than one table,depending on user input
    By interested in forum Excel General
    Replies: 8
    Last Post: 07-23-2012, 05:13 PM
  3. Using text box input to lookup number and replace based on user input into new column
    By harl3y412 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2011, 03:15 PM
  4. User input message box lookup table
    By cdw904 in forum Excel General
    Replies: 1
    Last Post: 05-02-2007, 11:27 AM
  5. Create a table based on user input?
    By S. Anders in forum Excel General
    Replies: 0
    Last Post: 02-09-2005, 09:36 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1