+ Reply to Thread
Results 1 to 6 of 6

Conditional Formatting Macro

  1. #1
    Registered User
    Join Date
    05-10-2018
    Location
    Pennsylvania
    MS-Off Ver
    Office 365
    Posts
    43

    Conditional Formatting Macro

    Hello!

    So I have 2 Columns. In Column A there are 3 specific text phrases. In Column B I have a monetary amount. I am trying to fill background or format the cell in B that corresponds with the text in A.

    E.g. If Column A says "Example 1", I want Column B to be light green. If Column A says "Example 2", I want Column B to be light yellow.
    Formatting.JPG

    I want to add this to a macro to run a report that automatically colors the cell in Column B instead of having to manually color it.

    Thanks in advance for any help!
    Last edited by Allienne; 09-17-2018 at 04:25 PM.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Conditional Formatting Macro

    .
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-10-2018
    Location
    Pennsylvania
    MS-Off Ver
    Office 365
    Posts
    43

    Re: Conditional Formatting Macro

    Logit,

    My columns are variable length and so the number of Example 1 and Example 2 do not stay the same across the board. Is there a way to incorporate this into a macro to run that can reference one cell and highlight another?

    Thanks!

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Conditional Formatting Macro

    .
    Please Login or Register  to view this content.
    I used RGB for the first two because it appears to be the closest match to the colors in your example.

    ColorIndex = 0 was used when neither term was present to leave the cell perimeter intact when no color is applied.


    I'm certain there are other methods to accomplish the goal, this is just one.
    Last edited by Logit; 09-17-2018 at 04:14 PM.

  5. #5
    Registered User
    Join Date
    05-10-2018
    Location
    Pennsylvania
    MS-Off Ver
    Office 365
    Posts
    43

    Re: Conditional Formatting Macro

    Logit,

    That worked great! Thank you so much!

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Conditional Formatting Macro

    .
    You are welcome !

+ 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] Conditional Formatting Macro
    By AsifShabbir in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-05-2016, 04:02 PM
  2. Macro to set up conditional message based on results of conditional formatting
    By paysola in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-04-2016, 12:38 AM
  3. [SOLVED] Conditional Formatting with Macro
    By ofd2008 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-30-2014, 09:28 AM
  4. Macro for formatting fonts and cell colours - not Conditional Formatting
    By Kayaness in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-07-2011, 03:46 AM
  5. Macro for conditional formatting
    By jbyrne in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-09-2010, 09:07 AM
  6. Conditional formatting using a macro.
    By Jay3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2008, 08:09 PM
  7. Conditional formatting macro
    By jimmyyang in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2008, 08:01 PM

Tags for this Thread

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