+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    03-06-2010
    Location
    Shanghai, China
    MS-Off Ver
    Excel 2007
    Posts
    3

    Formula for Macro

    i've been trying to work out a formula for what i'm about to explain, but i still can't figure it out. I don't even know if it's possible with excel, but it'd be great to get some suggestions anyway. Can someone help pleeaase?!

    I want to be able to have a drop down menu for column A which includes categories from my data sheet. And when i pick a category on column A from my data sheet, i want column be to only give me a drop down menu with items from each category.

    For Example: If i choose Camera on column A, I want column B to show me the list of items in the camera category. and if i choose Computer on column A, i want column B to show me the list of items in the computer category...and so on.
    (Please refer to the attached pictures)

    What kind of formula would i have to enter in Column A in order to make this happen? I've been trying to figure this out for a long time and i really hope somebody can help thank you!
    Attached Images Attached Images
    Last edited by tedinator; 03-07-2010 at 08:35 AM.

  2. #2
    Forums Administrator royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    24,443

    Re: Formula for Macro

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
    Check out the free Excel Toolbar

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)


    Code Tags: Make your code easier for us to read

  3. #3
    Registered User
    Join Date
    03-06-2010
    Location
    Shanghai, China
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Formula for Macro

    Let me try this again.

    When i select one of the following categories on my drop-down list in my Categories Column (column A...Figure1), i would like my items column (column B...Figure2) to automatically show a drop-down list of items in the Camera category, rather than displaying all the items on my list (Figure3).

    I hope my wording and my attachments are clearer on this post.
    Thank you!
    Attached Images Attached Images

  4. #4
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    18,225

    Re: Formula for Macro

    These are called Dependent Drop Down lists and they use named ranges and INDIRECT() references for Data Validation lists in the proceeding drop boxes.

    Here's a sample sheet I've posted showing how it's done. The sheet "CHOICES" has the dependent drop lists (and shows one of the dangers of using them) and the sheet "LISTS" shows the lists and named ranges in use.

    Have a look.

    Sample Files
    Jerry Beaucaire's Excel Tools
    The files you want are:
    --DependentLists3.xls - 3 levels
    --DependentLists2.xls - 2 levels
    --DependentLists-SelfSorting.xls - Self-Sorting lists of fruits by color choices



    NOTE: My samples utilize regular Data Validation drop downs created right in the cell. It does not use ComboBox drop downs from the Control Toolbox.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  5. #5
    Registered User
    Join Date
    03-06-2010
    Location
    Shanghai, China
    MS-Off Ver
    Excel 2007
    Posts
    3

    Talking Re: Formula for Macro

    Thank you so much! Everything was explained very well and with great detail. Thank you!

  6. #6
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    18,225

    Re: Formula for Macro

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

Thread Information

Users Browsing this Thread

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

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.2.0