+ Reply to Thread
Results 1 to 15 of 15

Populate items in data validation based on two option buttons for two columns

  1. #1
    Forum Contributor
    Join Date
    11-14-2021
    Location
    africa
    MS-Off Ver
    2016 & 2019
    Posts
    255

    Populate items in data validation based on two option buttons for two columns

    Hi
    I want populating items in data validation in column G based on select one of the option buttons .
    if I select optionbutton1 , then should populate list column J in column G , if I select optionbutton2 , then should populate list column K in column G .
    with some notices:
    1- I don't want any duplicates names in data validation for column G when populate items .
    2- I don't want any empty in in data validation for column G when populate items .
    3- if I add new names for two lists in columns J,K , then should populate items in data validation for column G automatically .
    I hope some body help
    thanks in advance .
    Attached Files Attached Files

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: Populate items in data validation based on two option buttons for two columns

    give the attached a trial - at present the validation will appear in the range "G2:G11"
    there are two small macros on the option buttons in the worksheet module.
    do not extend the lists (tables) with blank rows or formatted outlines.
    to add to the tables merely type in the row immediately under the table, it will then expand dynamically.
    to refresh the data validation click on the option button.
    note the data validation is done by the code - do not attempt to alter the data validation manually.
    Attached Files Attached Files
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,585

    Re: Populate items in data validation based on two option buttons for two columns

    Pl see file with worksheet event and a macro "Val_List".
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,728

    Re: Populate items in data validation based on two option buttons for two columns

    @kvsrinivasanurthy - please give more details in the post about the help you are offering so that anyone who can’t open the attachment will know what’s in there. Thank you.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: Populate items in data validation based on two option buttons for two columns

    @kvsrinivasanurthy - the O.P. made a number of requests which I believe I managed to achieve.
    I don't want any duplicates names in data validation for column G when populate items

  6. #6
    Forum Contributor
    Join Date
    11-14-2021
    Location
    africa
    MS-Off Ver
    2016 & 2019
    Posts
    255

    Re: Populate items in data validation based on two option buttons for two columns

    @torachan
    perfect !
    is there way to update the data validation automatically when one of the option button is selected instead of selecting and move from option button to another to see the updating .please ?

  7. #7
    Forum Contributor
    Join Date
    11-14-2021
    Location
    africa
    MS-Off Ver
    2016 & 2019
    Posts
    255

    Re: Populate items in data validation based on two option buttons for two columns

    @kvsrinivasamurthy
    thank you ,but I don't want duplicates in data validation .

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,585

    Re: Populate items in data validation based on two option buttons for two columns

    Pl see file with worksheet event and a macro "Val_List".
    Worksheet events
    Please Login or Register  to view this content.
    Macro code
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    11-14-2021
    Location
    africa
    MS-Off Ver
    2016 & 2019
    Posts
    255

    Re: Populate items in data validation based on two option buttons for two columns

    @kvsrinivasamurthy
    perfect !
    I search for way to update data validation when enter new items in any list without I have to move from option to another .
    I mean if the optionbutton1 is selected and add new items in list1 for column K , then automatically add new item in data validation instead of select optionbutton2 and return to select optionbutton1 to see updating in data validation .
    thanks

  10. #10
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,585

    Re: Populate items in data validation based on two option buttons for two columns

    Worksheet event.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    11-14-2021
    Location
    africa
    MS-Off Ver
    2016 & 2019
    Posts
    255

    Re: Populate items in data validation based on two option buttons for two columns

    @kvsrinivasamurthy
    you seem to missed some parts of the codes to put inside the file.
    excellent !
    this is exactly what I want it .
    thanks so much .

  12. #12
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,585

    Re: Populate items in data validation based on two option buttons for two columns

    Which part is missing?

  13. #13
    Forum Contributor
    Join Date
    11-14-2021
    Location
    africa
    MS-Off Ver
    2016 & 2019
    Posts
    255

    Re: Populate items in data validation based on two option buttons for two columns

    Which part is missing?
    Private Sub Worksheet_Change(ByVal Target As Range)

  14. #14
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,585

    Re: Populate items in data validation based on two option buttons for two columns

    It is available in Sheet1 worksheet event.
    Last edited by kvsrinivasamurthy; 05-29-2023 at 08:52 AM.

  15. #15
    Forum Contributor
    Join Date
    11-14-2021
    Location
    africa
    MS-Off Ver
    2016 & 2019
    Posts
    255

    Re: Populate items in data validation based on two option buttons for two columns

    It is available in Sheet1 worksheet event.
    just optionbutton1,2 are existed in in Sheet1 worksheet event.
    if you don't post the whole codes , then I say you the code doesn't still work as I want.
    just see the last attached and you will find out the missed code.
    others readers will be confused for them when download your file without contains the whole codes as you posted in last attachment.

+ 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] Populate Data Validation List with items shorter than 9 characters in range
    By BartH_NL in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-12-2021, 09:20 PM
  2. Replies: 2
    Last Post: 03-07-2018, 07:31 PM
  3. [SOLVED] Userform Option Buttons To Populate Listboxes
    By ScotyB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2015, 10:07 PM
  4. [SOLVED] Populate userform radio (option) buttons based on data in worksheet
    By d.sanchez in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-24-2013, 01:21 PM
  5. userform with 6 option buttons to populate 1 listbox
    By simeonmein in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-23-2013, 05:18 PM
  6. enable certain combo buttons based on user selected option buttons
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-20-2013, 06:43 AM
  7. Exclude items from Data Validation List based on another columns data
    By amartin575 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-19-2013, 11: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