+ Reply to Thread
Results 1 to 4 of 4

Selecting objects with checkboxes/toggle boxes

  1. #1
    Registered User
    Join Date
    09-28-2013
    Location
    North America
    MS-Off Ver
    Excel 2010
    Posts
    78

    Selecting objects with checkboxes/toggle boxes

    I was trying to make up a sheet to do some basic calculations but ran into an issue when I found out that you cannot embed checkboxes into cells. Rather, they float on top of the entire sheet. This is no good since I have 45 objects and having 45 checkboxes that are floating isn't at all ideal. If the spreadsheet layout ever changes then I'll have to manually move and fiddle with 45 checkboxes? No thank you.

    Now I'm completely at a loss on how to best go about this.

    Sample.xlsx

    I've attached just a small sample of how the columns will look. Like I said, there will be 45 objects and each object will have between 1 and 6 attributes. These attributes are in columns C through H. Column A is where I was going to place checkboxes. Toggle buttons would be really nice, but they are ActiveX only and I don't know if there are any reasons to avoid ActiveX or not.

    I would hide the attributes columns once I had it working and then put an output somewhere off on the right maybe in column J or K. The way it would work is you select any number of objects you'd like (in the real world you would be selecting no more than perhaps 3 or 4) and it would then compare attributes and output the attributes in the output column sorted by number of times they appear. If that doesn't make sense, an example would be if I select objects 8, 9, and 11 and then click the "Go" button the output column would list attributes 7-10 at the top (because there are two instances of it), then 7-11 (also because there are two instances) then it would list all the other attributes after since they each only appear once. Hopefully that is clear enough to understand.

    Each attribute can only exist three times, so the output cells can even be colored based on that. If an attribute exists three times in all the selected objects then it can be colored green. If it exists twice, yellow. Only once, red.



    Basically, I'm looking for a way to be able to easily select and deselect a number of rows that is easy enough to work with so that I can change the layout quickly and easily.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Selecting objects with checkboxes/toggle boxes

    This is my suggestion. You can just put regular "X" in column A to select items, as many as you wish.

    Notice the helper columns K:L where all the possible parameters are listed in order and a count of all the items currently selected?

    Then in column N is n array formula that is analyzing the data in columns K:L and pulling over a shorter list of just the used items along with the visible count. The list is in the same order as column K, not descending count. I hoped having the visible count instead would serve as an instant obvious result to get around that, I don't have an idea at the moment for getting the column N results in the order you suggested.

    So, to use, complete your table listing on the left all the way down through your 45 objects. Then expand the column K to list any additional parameters not already shown. You can hide columns C:L when your done, if wish.

    Column N array formula currently evaluates up to 200 column K values. If you edit that formula, be sure to confirm your edits by pressing CTRL+SHIFT+ENTER to reactivate the array.
    Attached Files Attached Files
    _________________
    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!)

  3. #3
    Registered User
    Join Date
    09-28-2013
    Location
    North America
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Selecting objects with checkboxes/toggle boxes

    While the solution is less than ideal, it's still more than I had hoped for. Thanks for taking the time to come up with a solution for me. Now I'll have to do a little research to figure out how those formulas work so that I can do this myself the next time around.

    I don't understand why Microsoft won't let us embed form controls into cells. Seems like such a simple thing, you know?

    Thank you.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Selecting objects with checkboxes/toggle boxes

    Not simple at all. Our eyes analyze things almost instantly, so we assume at times anything can equate. But cells in a sheet are a completely different creature than managed objects ON a sheet. With a non-trivial amount of coding, those objects can be leashed into behaving as if they were bound by the cells they float above, but it is a skilled endeavor. The gain is often minimal for the amount of work.

    I tried to make the formulas "ready to use". Hopefully the only thing you'd need to modify would be the helper column length.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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] Toggle multiple checkboxes (only one checkbox is allowed at a time)
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 04-14-2015, 06:20 AM
  2. use of toggle boxes to adjust union query
    By the_adam in forum Access Tables & Databases
    Replies: 0
    Last Post: 06-19-2013, 10:37 AM
  3. Using checkboxes to toggle between cell groups
    By dfairchild19 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-06-2013, 03:09 PM
  4. [SOLVED] Selecting subsets using combo boxes or list boxes
    By CLamar in forum Excel General
    Replies: 0
    Last Post: 06-01-2006, 02:45 PM
  5. Toggle Chart Series Objects On/Off
    By Raul in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-20-2006, 11:50 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