Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Button colour

I have a button on a userform. When a certain checkbox
is checked I want the button to appear black. I do this
using the BackColour property and using 17 as the color
number. When the checkbox is not checked I want to turn
the colour of the button back to grey. I am using 15 for
this. However, the button will not change to the colour
denoted by 15 when I do this. That is, it stays at black
(17) even if the chbkx = False. Why is this?

Thanks

If PrintColourMapChkBx = True Then
CellComColBtn.BackColor = 17
End if

If PrintColourMapChkBx = False Then
CellComColBtn.BackColor = 15
End If


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Button colour

Also note that I am doing all of this within the click
event of the chbkx

Private Sub PrintColourMapChkBx_Click()

If PrintColourMapChkBx = True Then
CellComColBtn.BackColor = 17
End if

If PrintColourMapChkBx = False Then
CellComColBtn.BackColor = 15
End If

End Sub


-----Original Message-----
I have a button on a userform. When a certain checkbox
is checked I want the button to appear black. I do this
using the BackColour property and using 17 as the color
number. When the checkbox is not checked I want to turn
the colour of the button back to grey. I am using 15 for
this. However, the button will not change to the colour
denoted by 15 when I do this. That is, it stays at black
(17) even if the chbkx = False. Why is this?

Thanks

If PrintColourMapChkBx = True Then
CellComColBtn.BackColor = 17
End if

If PrintColourMapChkBx = False Then
CellComColBtn.BackColor = 15
End If


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Button colour

You are using colorindex, not the color. Try

Private Sub PrintColourMapChkBx_Click()
If PrintColourMapChkBx = True Then
CellComColBtn.BackColor = &H0
Else
CellComColBtn.BackColor = &H8000000F
End If
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"ExcelMonkey" wrote in message
...
Also note that I am doing all of this within the click
event of the chbkx

Private Sub PrintColourMapChkBx_Click()

If PrintColourMapChkBx = True Then
CellComColBtn.BackColor = 17
End if

If PrintColourMapChkBx = False Then
CellComColBtn.BackColor = 15
End If

End Sub


-----Original Message-----
I have a button on a userform. When a certain checkbox
is checked I want the button to appear black. I do this
using the BackColour property and using 17 as the color
number. When the checkbox is not checked I want to turn
the colour of the button back to grey. I am using 15 for
this. However, the button will not change to the colour
denoted by 15 when I do this. That is, it stays at black
(17) even if the chbkx = False. Why is this?

Thanks

If PrintColourMapChkBx = True Then
CellComColBtn.BackColor = 17
End if

If PrintColourMapChkBx = False Then
CellComColBtn.BackColor = 15
End If


.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Button colour

thank-you bob. Quick question, what does the &H signify?
How do I know what code to use for what colour going
forward?




-----Original Message-----
You are using colorindex, not the color. Try

Private Sub PrintColourMapChkBx_Click()
If PrintColourMapChkBx = True Then
CellComColBtn.BackColor = &H0
Else
CellComColBtn.BackColor = &H8000000F
End If
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"ExcelMonkey" wrote

in message
...
Also note that I am doing all of this within the click
event of the chbkx

Private Sub PrintColourMapChkBx_Click()

If PrintColourMapChkBx = True Then
CellComColBtn.BackColor = 17
End if

If PrintColourMapChkBx = False Then
CellComColBtn.BackColor = 15
End If

End Sub


-----Original Message-----
I have a button on a userform. When a certain

checkbox
is checked I want the button to appear black. I do

this
using the BackColour property and using 17 as the color
number. When the checkbox is not checked I want to

turn
the colour of the button back to grey. I am using 15

for
this. However, the button will not change to the

colour
denoted by 15 when I do this. That is, it stays at

black
(17) even if the chbkx = False. Why is this?

Thanks

If PrintColourMapChkBx = True Then
CellComColBtn.BackColor = 17
End if

If PrintColourMapChkBx = False Then
CellComColBtn.BackColor = 15
End If


.



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Button colour

The H is Hex.

I got the colour code simply by looking at the BackColor property for a new
button, that told me it was
&H8000000F. I knew that black was &H0, as I know that white is &HFFFFFF, red
is &H0000FF, green is &H00FF00, and blue is &HFF0000, but beyond that I have
to look it up :-).

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ExcelMonkey" wrote in message
...
thank-you bob. Quick question, what does the &H signify?
How do I know what code to use for what colour going
forward?




-----Original Message-----
You are using colorindex, not the color. Try

Private Sub PrintColourMapChkBx_Click()
If PrintColourMapChkBx = True Then
CellComColBtn.BackColor = &H0
Else
CellComColBtn.BackColor = &H8000000F
End If
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"ExcelMonkey" wrote

in message
...
Also note that I am doing all of this within the click
event of the chbkx

Private Sub PrintColourMapChkBx_Click()

If PrintColourMapChkBx = True Then
CellComColBtn.BackColor = 17
End if

If PrintColourMapChkBx = False Then
CellComColBtn.BackColor = 15
End If
End Sub


-----Original Message-----
I have a button on a userform. When a certain

checkbox
is checked I want the button to appear black. I do

this
using the BackColour property and using 17 as the color
number. When the checkbox is not checked I want to

turn
the colour of the button back to grey. I am using 15

for
this. However, the button will not change to the

colour
denoted by 15 when I do this. That is, it stays at

black
(17) even if the chbkx = False. Why is this?

Thanks

If PrintColourMapChkBx = True Then
CellComColBtn.BackColor = 17
End if

If PrintColourMapChkBx = False Then
CellComColBtn.BackColor = 15
End If


.



.





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
command button colour Steve davis Excel Discussion (Misc queries) 2 April 12th 10 06:40 PM
Is it possible to change the blue colour of an activated Auto Filter button? Marcel Wilmink via OfficeKB.com Excel Discussion (Misc queries) 1 February 24th 05 08:35 PM
Macro button colour change??? Beefyme Excel Worksheet Functions 1 November 19th 04 06:15 PM
command button colour chrisdarl[_11_] Excel Programming 4 May 10th 04 12:08 AM
Colour Button Hank Scorpio Excel Programming 0 August 10th 03 11:03 AM


All times are GMT +1. The time now is 03:47 PM.

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

About Us

"It's about Microsoft Excel"