+ Reply to Thread
Results 1 to 15 of 15

Defined Name Table Refinement

  1. #1
    Registered User
    Join Date
    11-08-2015
    Location
    Denver, CO
    MS-Off Ver
    Office 2015
    Posts
    8

    Defined Name Table Refinement

    I have limited Excel experience. I recently tried a database type of functionality by using a chart, defining a named group and using validation for a drop down list of products. Then I use Index in a formula to find other chart values of the selected item, such as product specifications and pricing. This worked out great.

    But the drop down list is 104 items long. I would like to add some user input cells to constrain the drop down interactively by multiple criteria. I'm not sure how best to accomplish this.

    My Chart has Manufacturer, part number, Size, orientation that are key to choosing the right product.

    I could add fields for the user to choose one of the two manufactures. They orientation is also a binary choice. Then unit size, which is a BTU range.

    What I want to accomplish is to enter those values and have the drop down list trimmed down to just the items that meet it.

    What is the best function/approach/method of doing that? I've read some about filtering, advanced filtering, but I'm not sure which one is actually capable of the end result I'm trying to achieve.

    Can someone please point me in the right direction?

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Defined Name Table Refinement

    You are going down a blind alley.

    I use multiple text boxes to search for a product.

    you need some visual basic, but it is quite simple once you have a sample.
    Attached Files Attached Files
    Last edited by mehmetcik; 11-08-2015 at 05:12 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    11-08-2015
    Location
    Denver, CO
    MS-Off Ver
    Office 2015
    Posts
    8

    Re: Defined Name Table Refinement

    Much Appreciated! I got the feeling I could pour a lot of time in the wrong direction.

    I don't know anything about VB, really.

  4. #4
    Registered User
    Join Date
    11-08-2015
    Location
    Denver, CO
    MS-Off Ver
    Office 2015
    Posts
    8

    Re: Defined Name Table Refinement

    This is name defined chart:

    Untitled.jpg

    These are the values the user could specify:

    Manufacturer (which is binary choice)
    Orientation (which is binary)
    BTUs (which would be 2 fields defining a range. Such as 70,000 to 90,000)
    Blower Cap (also 2 fields defining a range. Such as 24,000 to 36,000)

    How would that be written in VB, generally?

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Defined Name Table Refinement

    This is a Sheet Based version:

    I am happy to help you adapt either version to meet your requirements.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Defined Name Table Refinement

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Defined Name Table Refinement

    What you are after is really easy. [ Famous Last Words ]

    I would create six drop down boxes

    Selecting the six boxes would populate a list box

    Clicking on the listbox will select your line.

    You say there are tw manufacturers but list only one.

    If you post a sample I will create something for you.

  8. #8
    Registered User
    Join Date
    11-08-2015
    Location
    Denver, CO
    MS-Off Ver
    Office 2015
    Posts
    8

    Re: Defined Name Table Refinement

    Working on that AFTER page right now. What does desensitize data mean?

  9. #9
    Registered User
    Join Date
    11-08-2015
    Location
    Denver, CO
    MS-Off Ver
    Office 2015
    Posts
    8

    Re: Defined Name Table Refinement

    The Before is really the Settings and Proposal Sheets. In the proposal Sheets, F16, K16, P16 and U16 are the set of dropdowns I want filter. Those named groups are from the Furnaces sheet.

    The After page has more details on the output i'm trying to achieve.

    Thanks
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Defined Name Table Refinement

    Sorry this is harder than I expected.

    This is my first pass using dummy data

    It has taken me ages to set up the Data Validation.

    Give them a go while I work out the next bit for you.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    11-08-2015
    Location
    Denver, CO
    MS-Off Ver
    Office 2015
    Posts
    8

    Re: Defined Name Table Refinement

    Looks good so far!

  12. #12
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Defined Name Table Refinement

    Ok

    open the attached file, it is preloaded with search data

    select the "Search" Tab, this will run the macro and display the list box.

    click on an entry, this will copy the entry into row 1.


    Play with this, and let me know where you would like to go from here.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    11-08-2015
    Location
    Denver, CO
    MS-Off Ver
    Office 2015
    Posts
    8

    Re: Defined Name Table Refinement

    Wonderful! That's the stuff. So I now I need to figure out the details.
    So I noticed the new stuff in the defined names. Each column were specifically using as criteria has 2 named groups. The first is:
    =INDIRECT("K5:K" & MATCH(9.99999999999999E+307,Database!$K:$K))
    I'm not familiar with what Indirect does. I looked it up but the general definition doesn't help me. I don't understand the match bit with the 9.999, but I do see the Database bit.
    The 2nd named group is:
    =INDIRECT("P2:P" & COUNTIF(Database!$P:$P,">0")+1)
    I think I can figure that one out, but if please let me know what the gist of it is, what its doing.

    Ok, so beyond this and the vb code, is there any other setup that is not readily observable?

    For the VB Code, that's something I have never tried. I have done some code. In high school. In the 80s. Was pretty good with Basic and Pascal.

    Were is the code entered? How can I observe what is currently embedded within the spreadsheet?

  14. #14
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Defined Name Table Refinement

    Ok so now you are happyish

    I will tell you what I have done. It would have been pointless before.

    Firstly did you see the uniquely sorted lists on the right of the data? Columns M to P inclusive?

    Those are the values that I used to create the Data Validation Lists in rows 3 and 4, side stepping the need for ComboBoxes.

    Lets focus on one of those lists.

    M1 to M 5 Contains the following values:-

    Manu
    DH
    KF
    KM
    PO

    This is a Unique Sorted List based on the data in your column B.

    The formula used is the array formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Entered using Ctrl Shift Enter.

    Manu

    Refers to a Dynamic Named Range which will adjust to cope with the amount of data you have ie as you add more rows.

    Select Formula, Name Manager and you will see that I have created 8 of these.

    The formula for Manu is:-

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This link is to a video that explains the above two formulas in great detail and a lot better than I could:-

    https://www.youtube.com/watch?v=IZLAzIYfMDU


    Manu2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This returns M2:M5 which is the list I want to use for the data validation in B3

    NB: This is a revised formula


    This formula works too:

    It is trial and error I am afraid

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Similar formulas for all 4 Data Validations

    Then I Selected Data Validation, selected from a list

    And used the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    to tell excell what list to use.




    Now for the Macros

    The first and simplest macro is in the Database Sheet, it is therefore sheet specific.

    Right Click on Database at the bottom of excel and select view code.

    this code will be displayed:

    Please Login or Register  to view this content.

    The Next Macro is also sheet specific but because I am using the tab as a macro button, it is more difficult to view.

    Select the Developer tab and then visual basic.

    Select view and then View and Project Explorer

    Double Click on Sheet2(Search)

    you should then see this code:-
    I think it is self explanatory

    Please Login or Register  to view this content.

    The final two Macros are in the userform.

    You access then in the same way as the last macro.

    Select the Developer tab and then visual basic.

    Select view and then View and Project Explorer

    Select the Userform

    Double click on the userform

    Please Login or Register  to view this content.


    The Last Macro is run when you select an entry on the listbox.



    Please Login or Register  to view this content.
    Last edited by mehmetcik; 11-11-2015 at 01:47 PM.

  15. #15
    Registered User
    Join Date
    11-08-2015
    Location
    Denver, CO
    MS-Off Ver
    Office 2015
    Posts
    8

    Re: Defined Name Table Refinement

    Wow! Thank you for tremendous detail in walking me through it. My work schedule prevents me from really digging in to it again until this weekend, but this gives me a wealth of knowledge to get it done. I have some other tables that need similar features, but it surely is just a matter of reference adjustments. Many, Many Thanks!

+ 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. [SOLVED] To many IF statements solved. Now, for the next refinement.
    By camcolo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-29-2013, 10:14 AM
  2. [SOLVED] Run Time 1004 - App Defined or Object defined error with String defined path structure
    By sarails in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-11-2012, 09:38 PM
  3. Table based on defined name, change defined name, how?
    By Dubrock in forum Excel General
    Replies: 0
    Last Post: 06-27-2012, 09:20 AM
  4. [SOLVED] Search function code refinement
    By IR Baboon in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-19-2012, 01:16 PM
  5. Application defined or object defined error when creating a Pivot Table
    By Kaigi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-02-2009, 05:05 PM
  6. Complex formula exists but needs refinement (very long)
    By zugfrig23 in forum Excel General
    Replies: 2
    Last Post: 09-22-2008, 02:27 AM
  7. macro refinement
    By Jonathan Cooper in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-09-2006, 08:49 AM
  8. [SOLVED] League Ladder refinement of Sorting.
    By Adeptus - ExcelForums.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-09-2005, 04:05 AM

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