Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / April 2008

Tip: Looking for answers? Try searching our database.

Cell colour change trigger event

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
midori - 26 Apr 2008 13:14 GMT
Hi,

I have a whole bunch of cells which are formatted differently based on
a master set of cells. What I'm trying to do is, when the user changes
the colour of any of the cells in the master set, the other cells with
the previous same formatting should accordingly. Unfortunately, it
doesn't seem like formatting changes trigger a recalculation.

My code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
       Dim k As Integer
       If Not (Target.MergeCells And IsInRange(Target,
Range("colorLegend"))) Then
           Exit Sub
       End If
      If legendMap Is Nothing Then
           genLegendMap
       End If
       For k = 0 To (legendMap.Count - 1)
           legendMap.Items(k).Interior.Color =
legendMap.Keys(k).Interior.Color
       Next k
End Sub

It's pretty silly considering that the colour of the cells only
changes if another cell is selected. Does anyone have a better way of
achieving what I mentioned at the top of my post?
Bob Phillips - 26 Apr 2008 14:14 GMT
There is no formatting event that you can trap. You would have to build a
facility that is used to invoke the colour change, and do the others at the
same time.

Signature

HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

> Hi,
>
[quoted text clipped - 23 lines]
> changes if another cell is selected. Does anyone have a better way of
> achieving what I mentioned at the top of my post?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.