+ Reply to Thread
Results 1 to 10 of 10

how do i make a toggle button change other toggle buttons value to false

  1. #1
    Forum Contributor
    Join Date
    03-10-2017
    Location
    USA
    MS-Off Ver
    office 2016
    Posts
    393

    how do i make a toggle button change other toggle buttons value to false

    I have 20 toggle buttons and I only want one true at any time. I can do this with 20 lines of code setting them all to false but I'm looking to do it with a loop. This is what im trying to do but its saying "togglebutton" is not defined. Not sure how to get it to workl

    Please Login or Register  to view this content.
    then use a similar code to select togglebutton2 and have 1 and 3-20 turn off
    Last edited by kevinu; 05-10-2018 at 12:32 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: how do i make a toggle button change other toggle buttons value to false

    Why not use Option buttons? That's their default behavior.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    03-10-2017
    Location
    USA
    MS-Off Ver
    office 2016
    Posts
    393

    Re: how do i make a toggle button change other toggle buttons value to false

    I tried but option boxes are way too small when I zoom out to where the page is useful. I can change the text size but the button itself is way to small. Unless you know how to make the button bigger?

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: how do i make a toggle button change other toggle buttons value to false

    Hello kevinu,

    What is your actual objective? Maybe you could consider doing it via a Userform?

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  5. #5
    Forum Contributor
    Join Date
    03-10-2017
    Location
    USA
    MS-Off Ver
    office 2016
    Posts
    393

    Re: how do i make a toggle button change other toggle buttons value to false

    I'm have a program that can view 20 different EEG scans. By clicking on a button your telling the program which data your wanting to work with. I have a separate load button that looks to see which button is toggled then loads the data to the location for that number... so if 1 is pushed it loads data to sheet1.. if 2 then sheet2 and so on. Its basically a glorified option button so the real program knows where to put stuff. I just cant get the option button to work because its soo small and hard to click.

    I havent used userform before but I'll look into that some. Right now I'm just using a sheet with buttons and toggles as a userform of sorts.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: how do i make a toggle button change other toggle buttons value to false

    Why not use a scrollbar linked to a cell to choose the row of interest?

  7. #7
    Forum Contributor
    Join Date
    03-10-2017
    Location
    USA
    MS-Off Ver
    office 2016
    Posts
    393

    Re: how do i make a toggle button change other toggle buttons value to false

    it would work its just more cumbersome. Its easier with how its set up to just click a button. It actually works now i just have a longer code and was curious if i could use a loop to untoggle the button instead of 20 lines saying togglebutton1.value = false, togglebutton2.value = true. etc.

    found this that works partially... but every time it changes a toggle it activates that buttons code

    Please Login or Register  to view this content.
    Last edited by kevinu; 05-10-2018 at 03:43 PM.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: how do i make a toggle button change other toggle buttons value to false

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    03-10-2017
    Location
    USA
    MS-Off Ver
    office 2016
    Posts
    393

    Re: how do i make a toggle button change other toggle buttons value to false

    Thanks that works great.. I'll keep looking into user form as well.

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: how do i make a toggle button change other toggle buttons value to false

    You're welcome.

+ 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. userform toggle button, 3 selection options? True, False and caption.
    By nvandyken in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-27-2015, 02:08 PM
  2. Toggle Button Does not Toggle OFF when Clicked
    By robbfamily in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-19-2014, 05:12 PM
  3. Toggle Button to Clear Option Buttons
    By nwb in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-24-2014, 05:58 PM
  4. Replies: 1
    Last Post: 02-13-2014, 10:55 PM
  5. Replies: 5
    Last Post: 08-01-2013, 04:30 AM
  6. How to make ActiveX Toggle Buttons mutually exclusive
    By gazza365 in forum Excel General
    Replies: 1
    Last Post: 01-19-2011, 10:18 PM
  7. NEW to VB - Using Toggle buttons to change cell data on another sheet
    By Imajika in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2010, 01:19 PM

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