+ Reply to Thread
Results 1 to 5 of 5

Option Buttons and Drop Down List: Form Control

  1. #1
    Registered User
    Join Date
    03-27-2008
    Posts
    75

    Option Buttons and Drop Down List: Form Control

    Hi Guys- I have two option buttons for the user to select either 'Canada' or 'US' and a drop down list in cell C7.

    If the Canada option button is selected cell c2=1 if the US option button is selected cell C2=2.

    If Canada option button is selected I need the cities in Q1:Q25 to appear in the drop down list (C7). If US option button is selected I need the cities in R1:R25 to appear in the drop down list (C7).

    Any help would be much appreciated.

    Thanks.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Sounds like a dependant list

    http://www.contextures.com/xlDataVal02.html

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    03-27-2008
    Posts
    75
    This dosen't really work when using radio/option buttons. I would use all drop downs but for some reson the boss wants option buttons. Thanks.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Do you currently have any code connected to the Option Buttons? Assuming not, I added this code to the buttons. Assuming your buttons are OptionButton1 and 2. I chose Cells (2,2) which is B2) because it is under my option button. Change this to fit your worksheet.
    Please Login or Register  to view this content.
    You can paste this code into the appropriate worksheet.

    Then use VBA Noob's reference to create dependent dropdowns using Data Validation using INDIRECT(B2). See my example.

    Questions?

    ChemistB
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-27-2008
    Posts
    75
    Quote Originally Posted by ChemistB View Post
    Do you currently have any code connected to the Option Buttons? Assuming not, I added this code to the buttons. Assuming your buttons are OptionButton1 and 2. I chose Cells (2,2) which is B2) because it is under my option button. Change this to fit your worksheet.
    Please Login or Register  to view this content.
    You can paste this code into the appropriate worksheet.

    Then use VBA Noob's reference to create dependent dropdowns using Data Validation using INDIRECT(B2). See my example.

    Questions?

    ChemistB
    This is PERFECT! Thanks Guys!

+ 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. Assign Multiple Macros to Drop Down List
    By rme8223 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2013, 01:17 PM
  2. Option Buttons, copying
    By Dfire in forum Excel General
    Replies: 21
    Last Post: 12-12-2006, 04:53 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