+ Reply to Thread
Results 1 to 3 of 3

Allowing only 1 toggle button pushed out of 2 choices

  1. #1
    Registered User
    Join Date
    08-23-2013
    Location
    Lititz Pennsylvania
    MS-Off Ver
    Excel 2010
    Posts
    4

    Allowing only 1 toggle button pushed out of 2 choices

    My worksheet has toggle buttons that say "Yes" and "No" that turn the cell they're in green or red, respectively. Right now you can select both toggles and have both cells be colored in. I would like it so when "Yes" is clicked (and green), and someone clicks "No", the "Yes" toggle goes off (and back to white), and vice versa, so that only one can be selected at a time. Is this possible? here is the code I'm currently using for the "Yes" toggle. "No" is the same, only it's ("H13") -


    Private Sub ToggleButton1_Click()

    If ToggleButton1.Value = True Then
    Range("G13").Select
    With Selection.Interior
    .Pattern = xlSolid
    .PatternColorIndex = xlAutomatic
    .Color = 5287936
    .TintAndShade = 0
    .PatternTintAndShade = 0
    End With

    Else
    Range("G13").Select
    With Selection.Interior
    .Pattern = xlNone
    .TintAndShade = 0
    .PatternTintAndShade = 0
    End With

    End If
    End Sub

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Allowing only 1 toggle button pushed out of 2 choices

    Use the code to turn the other one off.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-23-2013
    Location
    Lititz Pennsylvania
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Allowing only 1 toggle button pushed out of 2 choices

    That was easy! Thank you sir!

+ 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. Mouse Move not captured when button is pushed
    By dshj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-31-2013, 09:03 AM
  2. [SOLVED] VBA code that looks at which worksheet button was pushed
    By whatsmyname in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-08-2013, 02:39 PM
  3. Move Array in Z Pattern When Highlighted and Button Pushed
    By CIfromBury in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-15-2012, 07:49 PM
  4. Need macro's behavior to depend on button pushed
    By JChandler22 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-29-2010, 11:46 AM
  5. Dialog/Tick box allowing multiple choices
    By Dave32 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-07-2008, 09:43 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