Excel macro: color-code based on input, formula, or reference (blue, black, green)

Anonymous
2013-03-14T18:07:00+00:00

Hello,

Can you help me create or input a macro that will color-code cells in excel according to the following color-scheme (common in financial models)?

Blue - Hard-coded values (text or numbers)

Black - Formulas (example: =VLOOKUP(, =IF(, =OR(, etc.)

Green - References from another worksheet (example: =Sheet2!E15)

I would like to be able to select a range of cells, and then click a macro button on the toolbar that formats the cells in this way.  I am not very familiar with macros or visual basic.

Thank you very much for your help.

Ryan

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

7 answers

Sort by: Most helpful
  1. Anonymous
    2013-11-01T04:17:55+00:00

    Sure, no problem.

    Thanks,

    Virinder

    0 comments No comments
  2. Anonymous
    2014-12-11T21:21:20+00:00

    This was very helpful. Could you please tell me what it would be if I also wanted to show cells linking to another workbook as red?

    blue = hardcode

    black = formula

    green = link to another tab ("worksheet")

    red = link to another document ("workbook")

    Thank you!!

    1 person found this answer helpful.
    0 comments No comments