LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

 
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
CommandButton color change on event peter.thompson Excel Programming 4 December 17th 05 03:30 AM
Change BackColor Steve Excel Programming 1 July 11th 05 04:09 PM
Using A Macro To Add Event Procedure To A CommandButton Donna[_7_] Excel Programming 4 February 23rd 05 02:44 PM
Using A Macro To Add Event Procedure To A CommandButton [email protected] Excel Programming 1 February 21st 05 10:59 AM
Changing backcolor of commandbutton scottnshelly[_21_] Excel Programming 2 April 22nd 04 11:27 PM


All times are GMT +1. The time now is 10:16 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"