+ Reply to Thread
Results 1 to 2 of 2

Toggle Button push issue

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-11-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    517

    Toggle Button push issue

    Hi everyone, i have this code but why do i have to click on the button twice for it to be pushed? Does the same vise versa.
    Thanks for help

    Private Sub ToggleButton2_Click()
        If ToggleButton2 = True Then
            ToggleButton2.ForeColor = 255
        ElseIf ToggleButton2.Value = False Then
            ToggleButton2.ForeColor = &H80000012
        End If
        ToggleButton3 = False
    End Sub
    
    Private Sub ToggleButton3_Click()
        If ToggleButton3 = True Then
            ToggleButton3.ForeColor = 255
        ElseIf ToggleButton3.Value = False Then
            ToggleButton3.ForeColor = &H80000012
        End If
        ToggleButton2 = False
    End Sub

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Toggle Button push issue

    See if you need this....
    Private Sub ToggleButton2_Click()
        If ToggleButton2 = True Then
            ToggleButton2.ForeColor = 255
            ToggleButton3.ForeColor = &H80000012
        Else
            ToggleButton2.ForeColor = &H80000012
            ToggleButton3.ForeColor = 255
        End If
    End Sub
    
    
    Private Sub ToggleButton3_Click()
        If ToggleButton3 = True Then
            ToggleButton3.ForeColor = 255
            ToggleButton2.ForeColor = &H80000012
        Else
            ToggleButton3.ForeColor = &H80000012
            ToggleButton2.ForeColor = 255
        End If
    End Sub
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

+ 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. Combining separate button functions into one toggle button 2011 office for mac
    By voidcreativ in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-18-2015, 09:28 AM
  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. Replies: 1
    Last Post: 02-13-2014, 10:55 PM
  4. Delete a shape with a button push
    By jeff_kaufman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-02-2013, 02:20 PM
  5. graph on the push of a button
    By shortman_alan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-26-2008, 09:05 AM
  6. The color of a push button
    By Bobby in forum Excel General
    Replies: 8
    Last Post: 11-13-2005, 10:45 AM
  7. Push the button
    By chris in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-03-2005, 11:05 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