Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 90
Default Command Button Active X controls

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!

  #2   Report Post  
Posted to microsoft.public.excel.misc
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!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Active-X Controls - Transfer to Mac (excel) Jim May Excel Discussion (Misc queries) 4 August 22nd 07 09:08 PM
Merge command not active Stilla Excel Worksheet Functions 1 May 4th 07 08:00 AM
Active X Controls PA New Users to Excel 3 October 30th 05 04:33 PM
How do I stop active x controls from moving after a print preview mleavitt Excel Discussion (Misc queries) 2 September 12th 05 08:47 PM
Active X controls dksoreal Excel Discussion (Misc queries) 2 June 30th 05 02:35 PM


All times are GMT +1. The time now is 06:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"