+ Reply to Thread
Results 1 to 5 of 5

[VBA] changing cell color based on another cell color

Hybrid View

  1. #1
    Registered User
    Join Date
    04-21-2020
    Location
    Finland
    MS-Off Ver
    Office365, Mac
    Posts
    17

    [VBA] changing cell color based on another cell color

    Hi,

    seems like the only way to do following:
    change A1 cell color based on A2 color, no other (traditional conditional format approach) conditions needed

    is to use VBA. Conditional format does not work here and haven't been able to come up with formula based approach. Will use the VBA as an last option, but anyone knowing any workarounds for change of cell color?

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,695

    Re: Conditional format or formula for changing cell color based on another cell color

    No, not possible without VBA if the cell colour of A2 has been applied manually (i.e. not via a CF rule).

    Shall I move the thread for you?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    04-21-2020
    Location
    Finland
    MS-Off Ver
    Office365, Mac
    Posts
    17

    Re: Conditional format or formula for changing cell color based on another cell color

    Hi,

    thanks for reply - exactly as I though, only VBA.

    So, yes you can move the thread.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,695

    Re: [VBA] changing cell color based on another cell color

    Done, and updated the thread title to match.

  5. #5
    Registered User
    Join Date
    04-21-2020
    Location
    Finland
    MS-Off Ver
    Office365, Mac
    Posts
    17

    Re: [VBA] changing cell color based on another cell color

    Hi,

    seems like there's an simple wa by VBA with following code:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Me.Range("D1").Interior.Color = Me.Range("B1").Interior.Color
    End Sub

    So, I might consider this as solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Changing the color of a bar based on the color of a cell.
    By sungen99 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-02-2019, 10:26 AM
  2. Change cell format (cell color+font color) based on color of another cell
    By Dedaluss in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2017, 03:27 AM
  3. Replies: 3
    Last Post: 08-18-2014, 12:47 PM
  4. [SOLVED] Changing fill color of shapes based on changing cell value
    By Stefan1983 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-25-2012, 10:33 AM
  5. Changing a cell's color based on it's color and the value of another cell
    By lorr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2012, 01:09 PM
  6. Replies: 2
    Last Post: 01-27-2012, 09:40 PM
  7. macro: changing cell color based on date in cell
    By CindyG in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-13-2009, 12:10 PM

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