Results 1 to 3 of 3

change button colour when clicked

Threaded View

  1. #1
    Registered User
    Join Date
    03-01-2012
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2010
    Posts
    64

    change button colour when clicked

    Hello people

    This follows on from a previous post about changing the text in a button when clicked, my code now looks like this:

    Sub Button16_Click()
    
        Dim strCap As String
    
        With Columns("M:R").EntireColumn
            .Hidden = Not .Hidden
            If .Hidden Then
                strCap = "Show R&R"
            Else
                strCap = "Hide R&R"
            End If
        End With
    
    ActiveSheet.Buttons(Application.Caller).Caption = strCap
    
    End Sub
    What I want to now do is change the colour of the button to green when it displays the 'Hide R&R' option (when it says 'Show R&R' the colour can stay the same standard grey). How do I do this? Can anyone help please?

    Thanks
    Kenny
    Last edited by arlu1201; 12-14-2012 at 02:46 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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