View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default Command Button Active X controls

hi
you might try something like this...
Private Sub Commandbutton2_Click()
With Commandbutton2
.BackColor = RGB(0, 0, 255) ' blue
.Caption = "Selected"
.ForeColor = RGB(245, 245, 6) 'yellow
End With
Commandbutton3.Enabled = False
run your code here?
End Sub
see this site for RGB colors....
http://www.mvps.org/dmcritchie/excel/colors.htm
but a word of caution. if you are going to disable a control, you need a way
to enable it again. I would suggest that at the end of the code that the
selected button runs, you enable all of the buttons that you disabled and
change all the colors back.

Regards
FSt1
"Kenny" wrote:

I have six command buttons that filter a sheet based on criteria. I have the
filter built. I want to see if someone can provide me with code to make the
command button look selected or filled grey when it is selected. Of course
when one is selected I need the others to be turned off. Can anyone help me.
Thanks!