+ Reply to Thread
Results 1 to 6 of 6

Code for index, indirect, lookup etc

  1. #1
    Forum Contributor
    Join Date
    02-23-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    133

    Code for index, indirect, lookup etc

    Hello,


    I have a sheet with 2 columns. Column A has Make of the car and column B has the model of that make. Since past 3 days i am googling around and posting on all forums to figure out how can i:

    1. Have a dropdown to select "Make" in a cell and
    2. Get corresponding model (again in a dropdown) in another cell.
    3. Auto complete feature would be a luxury but not a necessity. For eg, i type H and it gives me Honda and Hyundai in drop down.

    Please find attached sheet. Getting D3 is easy, i can use LIST and validation. But how do i get E3? Without any helper column? Also i may add more data below in future and it should update automatically. I dont mind giving 10,000 rows as reference in advance.
    PS: i can work hard and make sure that Values in column B remain UNIQUE (If that makes things easier) Is it possible to have duplicate values in column B and still have unique values in drop down box?

    I tried using all possible functions and data validations and LOTs of helper columns, but i think it's not possible without vba.

    Below is my another thread on same issue posted under formulas and functions.

    http://www.excelforum.com/excel-form...drop-down.html

    Thank you for your time.
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Code for index, indirect, lookup etc

    I'd create a matrix with the Makes across the top and the list of Models underneath. Then you can create a Named Range from the top row for the Make.

    Create a Structured Table for each Make. Name the Table "tab" and the Make, for example, tabBMW.

    You can then use INDIRECT to reference the Models for each Make.

    See the updated example as a starter. It's set up as far as Datsun.

    Regards, TMS
    Attached Files Attached Files
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Code for index, indirect, lookup etc

    Quote Originally Posted by moonbreakker View Post
    3. Auto complete feature would be a luxury but not a necessity. For eg, i type H and it gives me Honda and Hyundai in drop down.
    ActiveX combobox with vba solution
    1) Sheet1 code module
    Please Login or Register  to view this content.
    2) ThisWorkbook code module
    Please Login or Register  to view this content.
    ComboBox1 liked with D3
    ComboBox2 linked with E3

    So you can refer those cells for formula or something else.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    02-23-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    133

    Re: Code for index, indirect, lookup etc

    Oh! awesome! Jindon that was what i exactly needed. I will have to read codes for 2 days. :-) Got what i needed. Thank you. Thank you TMS too for your time. I did not want to create a matrix or a helper column because it's difficult to maintain it (error proof).

    Thanks.

  5. #5
    Forum Contributor
    Join Date
    02-23-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    133

    Re: Code for index, indirect, lookup etc

    It's too much to ask for Jindon.. If you don't mind can you explain me in very brief Set dic = CreateObject("Scripting.Dictionary") and CreateObject("System.Collections.ArrayList") ?

    Sorry, just over excited with the neat output.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Code for index, indirect, lookup etc


+ 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. Index/indirect, REF problem
    By SannyW in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-30-2015, 07:14 PM
  2. [SOLVED] Double Index Match by Indirect Lookup Arrays
    By Erickson28 in forum Excel General
    Replies: 18
    Last Post: 07-30-2015, 12:46 PM
  3. Index indirect with sumif
    By namluke in forum Excel General
    Replies: 1
    Last Post: 03-15-2014, 03:50 PM
  4. Named range lookup using Index/Indirect/Match Function calls in Macro
    By sgopan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-27-2013, 07:51 PM
  5. Index/Indirect/Match Help
    By robertsclark in forum Excel General
    Replies: 2
    Last Post: 04-20-2011, 10:24 AM
  6. index...indirect
    By jw01 in forum Excel General
    Replies: 9
    Last Post: 03-30-2011, 05:16 PM
  7. Indirect vs. Index
    By WJ in forum Excel General
    Replies: 3
    Last Post: 06-10-2005, 06: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