+ Reply to Thread
Results 1 to 8 of 8

Showing selected check box titles in cell

  1. #1
    Registered User
    Join Date
    03-05-2020
    Location
    Stoke on Trent, England
    MS-Off Ver
    Excel 2016
    Posts
    59

    Showing selected check box titles in cell

    Hi all,

    I am wanting to show whatever I have selected in my checkboxes to be displayed in a cell L19 for instance, in my example I have hat, tie and shoe as different checkboxes.

    When I select one or more I need to show what has been selected in a cell for instance if two are selected then cell should contain "tie, shoe" and three "tie, shoe, hat"

    This is part of a bigger project where I save check box info into a table for reference later on but the example ive created will allow me to work it in when I know the principle of how it works.
    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,409

    Re: Showing selected check box titles in cell

    lines added to present macro
    takes the 'name' string from the checkbox caption.
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Showing selected check box titles in cell

    Or maybe try like this:

    Please Login or Register  to view this content.
    call the test sub just before the end sub of each CheckBox_Click

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,955

    Re: Showing selected check box titles in cell

    Replace all your code with this...
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  5. #5
    Registered User
    Join Date
    03-05-2020
    Location
    Stoke on Trent, England
    MS-Off Ver
    Excel 2016
    Posts
    59

    Re: Showing selected check box titles in cell

    This works perfectly.

    In my proper sheet what I am selecting are model numbers instead of text. Is there any way to adjust the code and make the numbers always appear in sequence of lowest 1st to highest? I use a match function later which is dependant on them being in the same order all the time.

  6. #6
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,955

    Re: Showing selected check box titles in cell

    Can't say...need an accurate representation of your actual file...

    It is very important to always upload sample files that depict your exact set-up...
    I see it happen all the time...Members wasting time on code because it does not fit the users actual file setup...

  7. #7
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,955

    Re: Showing selected check box titles in cell

    In my proper sheet what I am selecting are model numbers instead of text.
    If you are referring to the CheckBox Captions being numbers then one can store them in an array to recall later on...

  8. #8
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Showing selected check box titles in cell

    Quote Originally Posted by Kevchenk0 View Post
    In my proper sheet what I am selecting are model numbers instead of text.
    in my example I have hat, tie and shoe as different checkboxes
    A.
    Do you mean that the checkboxes are not text, but number ?
    Example :
    checkbox1 caption : 10
    checkbox2 caption : 5
    checkbox3 caption : 3


    OR

    B.
    Do you mean that checkboxes are text, but that text has model number ?
    Example :
    caption hat in checkbox1 model number is 10
    caption tie in checkbox2 model number is 5
    caption shoe in checkbox3 model number is 3



    Is there any way to adjust the code and make the numbers always appear in sequence of lowest 1st to highest?
    Either A or B, you want the result like this :
    If the user click checkbox1 and click checkbox2
    then you want the display result in cell L19 is : 5, 10

    another example:
    the user click checkbox1 and click checkbox3
    then you want the display result in cell L19 is : 3, 10

    another example:
    the user click checkbox2 and click checkbox3
    then you want the display result in cell L19 is : 3, 5

    another example:
    all three checkboxes are selected
    then you want the display result in cell L19 is : 3, 5, 10

    Anyway, below is the code for model-A: (the CheckBox caption is not a text but a number)
    Please Login or Register  to view this content.
    call the test sub just before the end sub of each Private Sub CheckBox_Click()
    Last edited by karmapala; 06-19-2020 at 07:38 AM.

+ 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. Showing Userform depending on selected cell in column
    By BorisJ in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-15-2016, 04:33 AM
  2. Replies: 2
    Last Post: 03-24-2016, 10:55 AM
  3. [SOLVED] Sum with date criteria then showing when selected cell
    By Jhon Mustofa in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-23-2014, 02:04 PM
  4. Showing Info on a Userform based on Selected Cell
    By aijp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-01-2013, 03:00 PM
  5. Replies: 3
    Last Post: 06-05-2012, 01:45 PM
  6. How to check if selected cell is in row 10
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-14-2009, 12:41 AM
  7. Showing selected cell value
    By Misssy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-11-2005, 01:55 PM

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