+ Reply to Thread
Results 1 to 6 of 6

VBA to 'read' a cell's color?

  1. #1
    Forum Contributor
    Join Date
    05-23-2007
    Posts
    126

    VBA to 'read' a cell's color?

    I have two tabs. Tab "A" contains data that is pasted during a macro. Tab "B" uses INDEX and MATCH formulae to return values from "A" because the row and columns vary week to week.

    Here's the challenge.... The data in the cells in tab "A" will be either 'no fill', or green, or red. I would like for the corresponding linked-cell in "B" to also have the color of it's twin on "A"...

    I'm told that absent a rule for the colors (there is none), that VBA would be my only hope... Help me Obi-Wan.

    Thank you for any direction!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: VBA to 'read' a cell's color?

    If the cell color is applied manually on tab A, there's no way to make the color on tab B change automatically in response.

    If it's changed by conditional formatting, use the same rule on tab B.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    05-23-2007
    Posts
    126

    Re: VBA to 'read' a cell's color?

    shg... if not automatically, could it be done using VBA? Seems somewhere in the matrix there should be 'instructions' for coloring the cell in A, that could be read.....?

    Holding out hope.....

    Of course, as you have almost 36,000 posts... gonna guess that you know what you're talking about....

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: VBA to 'read' a cell's color?

    There's nothing in Excel that would enable it to happen automatically as a result of changing a cell color.

    You could test in the Calculate event (so it would check any time you change anything), but it could make the worksheet slow, and it would kill Undo -- which is a very high price to pay for a cosmetic effect.

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: VBA to 'read' a cell's color?

    Assuming both sheets are not displayed at once you could use the sheet activate event to apply all changes whenever the user changes what sheet is active
    Cheers
    Andy
    www.andypope.info

  6. #6
    Forum Contributor
    Join Date
    05-23-2007
    Posts
    126

    Re: VBA to 'read' a cell's color?

    pasting a link below, that I came across... does this have any promise? I'm only using red and green, so maybe the color theme wouldn't matter?

    http://stackoverflow.com/questions/2...get-cell-color

+ 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. Function to read cell color and insert Letter?
    By AmazingTrans in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-19-2015, 12:39 AM
  2. Swapping cell content to INCLUDE CELL FORMATTING (Text color, background color, etc)
    By jcpeterson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-10-2014, 10:09 AM
  3. Formula to read code in Column D, then apply color to columns a, b, c?
    By Lorann in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-28-2014, 07:10 PM
  4. Macro to change cell text color based on darkness of cell fill color
    By cincyshirm61 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-25-2014, 12:11 PM
  5. Replies: 4
    Last Post: 12-29-2013, 11:41 PM
  6. Read picture-pixel color ?
    By onidarbe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-10-2009, 05:10 PM
  7. How to read pixel color
    By keram in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2005, 06:36 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