+ Reply to Thread
Results 1 to 16 of 16

nested toggle boxes that hide/unhide rows??

  1. #1
    Registered User
    Join Date
    05-12-2015
    Location
    Australia
    MS-Off Ver
    365
    Posts
    6

    Question nested toggle boxes that hide/unhide rows??

    Hi, I'm very new to excel programming and I've found this site super useful, so thanks in advance.

    I need to ask a question of my own because my toggle boxes are going crazy.

    I would like to have a toggle box that hides/unhides a few rows that also have toggle boxes in them. I have started with the first few rows and it works fine, but when i add a toggle box that hides those rows, they all move down into the next row on top of each other!

    I'm guessing that when I place the toggle box in a cell, its not actually "in" that cell, but just on top of it? and I think that's my problem, but I have no idea how I could solve it.

    In the picture, there should be toggle boxes next to each line of green text, but they have all stacked on top of each other next to the orange line of text. Even when I move them back to their proper spot they do not work anymore.

    Any ideas??
    Attached Images Attached Images

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: nested toggle boxes that hide/unhide rows??

    Hi, and welcome to the forum

    Perhaps set the toggle box (by which I assume you mean a drawing rectangle shape) properties to 'Don't move or size with cells'.

    But if I've misunderstood please upload the workbook and clarify.
    Last edited by Richard Buttrey; 05-12-2015 at 08:36 PM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    05-12-2015
    Location
    Australia
    MS-Off Ver
    365
    Posts
    6

    Re: nested toggle boxes that hide/unhide rows??

    Thanks so much for your reply
    sorry yeh i meant toggle button, in the activex control

    I've selected 'dont move or resize with cells' and the buttons are working now which is great!
    except I would like them to move inline with the green text and be hidden if the green text is hidden.

    ill upload the workbook, its a bit difficult for me to explain

    basically im trying to hide/unhide in groups, like this

    orange
    green
    blue
    blue
    green
    blue
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: nested toggle boxes that hide/unhide rows??

    oh man...do you really need to use toggle buttons?
    would group outlines not work for you?

    is it coloured that way in your actual file or are you doing it to help show us?

    also so im understanding what you want correctly
    is the group outline sheet i have attached how you imagine it to work?
    click 1 shows all orange
    click 2 shows all green
    click 3 shows all blue
    Attached Files Attached Files
    Last edited by humdingaling; 05-12-2015 at 10:25 PM.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    Registered User
    Join Date
    05-12-2015
    Location
    Australia
    MS-Off Ver
    365
    Posts
    6

    Re: nested toggle boxes that hide/unhide rows??

    yep that's exactly what i want it to do

    i would like to use something that is user friendly, so that a button or something is next to the words
    is there a way to use a button to control the group outlines, so that the button does the same function as the group outline button on the side?

    maybe theres something wrong with my vba code or the toggle buttons aren't meant to work that way...

    yeh i will be using different colours for the different levels

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: nested toggle boxes that hide/unhide rows??

    unfortunately outline does not have labels

    you can either work with labels instead...which are much easier to manage

    or continue with your lengthy coding

    ive started with it...but the road is long
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: nested toggle boxes that hide/unhide rows??

    now i've show you this...if you want to just do at group level...then the coding can be much easier

    ie show all blue at once or show all green at once

  8. #8
    Registered User
    Join Date
    05-12-2015
    Location
    Australia
    MS-Off Ver
    365
    Posts
    6

    Re: nested toggle boxes that hide/unhide rows??

    Thanks heaps i tried to continue with the coding but it seems excel just doesn't like hiding buttons..
    i like the idea of using the group outlines so I've made buttons that display the whole group level which is working fine!

    If ToggleButton1.Value = True Then
    ActiveSheet.Outline.ShowLevels RowLevels:=2
    Else
    ActiveSheet.Outline.ShowLevels RowLevels:=1
    End If

    I wonder if it is possible to label the group outlines, so that you can see what section you are hiding/unhiding?
    Haven't found anything so far

  9. #9
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: nested toggle boxes that hide/unhide rows??

    i havent seen example of anyone doing the group outline label

    you may just want to do use activex label instead
    seems easier to manage than toggle buttons to me

  10. #10
    Registered User
    Join Date
    05-12-2015
    Location
    Australia
    MS-Off Ver
    365
    Posts
    6

    Re: nested toggle boxes that hide/unhide rows??

    hmmm weird thing i found out, if you select 'move AND resize with cells' the toggle buttons hide/unhide properly without jumping around when they are hidden. however they also resize when the rows are expanded which looks ridiculous haha, but if i select 'move and DONT resize' then they jump around again..

    any way to get the best of both worlds?
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: nested toggle boxes that hide/unhide rows??

    maybe a different approach (coding is cleaner and easier to manage)
    using the font color
    Attached Files Attached Files
    Last edited by humdingaling; 05-14-2015 at 10:01 PM.

  12. #12
    Registered User
    Join Date
    03-26-2014
    Location
    Nowhere, somewhere
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: nested toggle boxes that hide/unhide rows??

    Just offering this as an alternative. Would using a treeview work for you? see: http://www.cpearson.com/Excel/foldertreeview.aspx for an example.

  13. #13
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: nested toggle boxes that hide/unhide rows??

    treeview is for file structure (folders/subfolders/files)...how would you alter that to be information from sheet?

  14. #14
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: nested toggle boxes that hide/unhide rows??

    http://dailydoseofexcel.com/archives...orms-treeview/
    well learnt something new then

    maybe worth investigating i havent used it myself

  15. #15
    Registered User
    Join Date
    03-26-2014
    Location
    Nowhere, somewhere
    MS-Off Ver
    Excel 2007
    Posts
    75

    Re: nested toggle boxes that hide/unhide rows??

    Quote Originally Posted by humdingaling View Post
    treeview is for file structure (folders/subfolders/files)...how would you alter that to be information from sheet?
    A treeview can be used to display a file structure, but it is just a visual way to present outlined information and that is what I am interpreting the OP's goal to be.

  16. #16
    Registered User
    Join Date
    05-12-2015
    Location
    Australia
    MS-Off Ver
    365
    Posts
    6

    Re: nested toggle boxes that hide/unhide rows??

    awesome, i've learnt heaps so far and I can't thank you guys enough

+ 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 Button to hide/unhide rows based on value
    By goomblar in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-03-2014, 07:35 AM
  2. [SOLVED] Macro to toggle between hide/unhide rows
    By fpt264 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-24-2014, 04:30 PM
  3. Macro to toggle between Hide and Unhide rows
    By fpt264 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-14-2013, 01:47 PM
  4. [SOLVED] Using Tick Boxes to Hide/ Unhide a selection of rows
    By Andrew E Smith in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2013, 12:36 PM
  5. Using Toggle Button to hide/unhide rows that may change
    By jmpatrick in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-09-2011, 09:48 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