View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
peter.thompson[_3_] peter.thompson[_3_] is offline
external usenet poster
 
Posts: 1
Default Commandbutton backcolor change on event


Further to my post yesterday, I need to have a commandbutton change its
color when the content of a cell changes in another worksheet from
blank("") to a value

Had the following suggestion from a board member(thanks!)

Private Sub Worksheet_Change(ByVal Target As Range)
Const sAdd As String = "A1" '<<==== CHANGE

If Not Intersect(Range(sAdd), Target) Is Nothing Then
With Me.CommandButton1
If IsEmpty(Target) Then
..BackColor = &HFFFF&
Else
..BackColor = &HFF&
End If
End With
End If

End Sub


This works if I manually enter a value or "" into say"A1" on the sheet,
but not if the value changes in "A1" as a result of a formula - any
ideas welcome!

Also, what do I need to add to the code to say refer to "A1" in another
worksheet??

Cheers

Peter


--
peter.thompson
------------------------------------------------------------------------
peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686
View this thread: http://www.excelforum.com/showthread...hreadid=494302