+ Reply to Thread
Results 1 to 2 of 2

Trigger a macro based on cell colour change

  1. #1
    Registered User
    Join Date
    08-12-2009
    Location
    Perth, WA
    MS-Off Ver
    Excel 2003
    Posts
    93

    Trigger a macro based on cell colour change

    Hi, is there a way to trigger a macro when a cell changes colour?

    Thanks

  2. #2
    Forum Moderator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    365
    Posts
    20,574

    Re: Trigger a macro based on cell colour change

    Not directly. If a cell changes its value, you can capture the

    Worksheet_Change

    event to trigger a macro. But changing a cell color (or any other aspect of its formatting) does not cause this or any other event to occur.

    A rather convoluted way to to this would be to create an array to record the cell colors in VBA, and capture the Select event. Every time a cell is selected you would compare all cell colors to the ones in the array to see if anything changed.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1