+ Reply to Thread
Results 1 to 7 of 7

How to automate the selection of second dropdown value based on first dropdown value

  1. #1
    Registered User
    Join Date
    01-12-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    73

    How to automate the selection of second dropdown value based on first dropdown value

    Hi,

    In my word document i have created two dropdown list. The first dropdown contains "names" and the second dropdown contains respective "phone numbers". Is it possible that selecting a name from the first dropdown will automatically change the second dropdown value based on the name selected in first dropdown? If yes, can you please tell how to do this. I am using word 2007.

    Thank you.

  2. #2
    Forum Guru macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,494

    Re: How to automate the selection of second dropdown value based on first dropdown value

    You don't need two dropdowns for this unless your aim is to allow the user to select from either the list of names or the list of phone numbers. For an implementation of conditional output, see: http://www.msofficeforums.com/word/1...own-lists.html
    Last edited by macropod; 05-06-2014 at 10:52 PM.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    01-12-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    73

    Re: How to automate the selection of second dropdown value based on first dropdown value

    Hi,

    Thank you for replying.
    The link which you have suggested helped me. In my document first line contains 'department code', second person 'name', and third 'Designation'. Based on the code from the above link, i was able to achieve this-selecting a value in first content control changes the second control accordingly. But how to also change the third content control value, i.e designation?. Can you please help further as i am new to vba. I have attached my document here. Thank you.
    Attached Files Attached Files

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16
    Posts
    50,572

    Re: How to automate the selection of second dropdown value based on first dropdown value

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Guru macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,494

    Re: How to automate the selection of second dropdown value based on first dropdown value

    You could change your "" content control's values to, for example:
    "Amar|Facilitator", for "Amar from H2"
    and combine that with a macro coded like:
    Please Login or Register  to view this content.
    Alternatively, you could modify just the macro itself, so that nothing needs to be input as the "Details" content control values. For an example of that approach, see: http://www.excelforum.com/word-progr...into-word.html

  6. #6
    Registered User
    Join Date
    01-12-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    73

    Re: How to automate the selection of second dropdown value based on first dropdown value

    THANK YOU VERY MUCH!
    one last question, what line of code should be used to perform action like-
    If content control 1 value is "Fruit" then change content control 2 value to "Apple".

    Have a nice day.

  7. #7
    Forum Guru macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,494

    Re: How to automate the selection of second dropdown value based on first dropdown value

    I'd have thought is perfectly obvious you'd use:
    Fruit|Apple

+ 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. Replies: 2
    Last Post: 10-07-2013, 11:06 AM
  2. Replies: 1
    Last Post: 07-03-2013, 10:50 AM
  3. vLookUp based on dropdown selection
    By michaelof36 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-20-2012, 08:30 PM
  4. Cull dropdown list options based on selection in another dropdown
    By Kiffar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-20-2012, 01:53 AM
  5. Replies: 2
    Last Post: 08-11-2011, 01:32 AM

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