Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
CommandButton color change on event | Excel Programming | |||
Change BackColor | Excel Programming | |||
Using A Macro To Add Event Procedure To A CommandButton | Excel Programming | |||
Using A Macro To Add Event Procedure To A CommandButton | Excel Programming | |||
Changing backcolor of commandbutton | Excel Programming |