+ Reply to Thread
Results 1 to 4 of 4

Recording a Macro for Conditional Formatting

  1. #1
    Registered User
    Join Date
    10-16-2019
    Location
    Coventry, England
    MS-Off Ver
    2010 / Office 365
    Posts
    2

    Question Recording a Macro for Conditional Formatting

    Hello,
    I tried to record a macro to create conditional formatting rules, but to no avail.
    1. First request, how to record a macro from conditional formatting rules?
    2. Second request, please write me the VBA code of the following conditional formatting rules.

    Conditional Formatting:
    Formula =O5<=N5 (Font RED) Applies to =$N5:$Q$168
    Formula =O5>=N5 (Font GREEN) Applies to =$N5:$Q$168

    Help much appreciated,

    Thanks,
    Kerri-Anne

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Recording a Macro for Conditional Formatting

    Start macro recording
    Select cells N5:Q168
    Select Conditional Formatting from the menu and apply these Rules
    Formula =$O5<=$N5 (Font RED)
    Formula =$O5>=$N5 (Font GREEN)
    Stop recording

    Decide which rule gets the equal sign otherwise it defaults to the the first rule.
    Last edited by AlphaFrog; 10-16-2019 at 06:45 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    10-16-2019
    Location
    Coventry, England
    MS-Off Ver
    2010 / Office 365
    Posts
    2
    Quote Originally Posted by AlphaFrog View Post
    Start macro recording
    Select cells N5:Q168
    Select Conditional Formatting from the menu and apply these Rules
    Formula =$O5<=$N5 (Font RED)
    Formula =$O5>=$N5 (Font GREEN)
    Stop recording

    Decide which rule gets the equal sign otherwise it defaults to the the first rule.


    Sorry, perhaps I should have been clearer, this is exactly what I did however it didn’t work...

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Recording a Macro for Conditional Formatting

    Show your recorded macro

    Did you use the red $. They are necessary.

    What exactly does "didn't work" mean; wrong cells highlighted, no cells highlighted, code errors?

+ 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. Trouble with Conditional Formatting with Marco recording
    By dmrf in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-24-2018, 05:27 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. Formatting the excel file by manually recording macro
    By rhyne23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2015, 08:02 AM
  4. VBA macro not recording conditional formatting rules
    By Enoryt in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2013, 10:18 AM
  5. Recording a macro to link workbooks with conditional information
    By dragonfly352758 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-11-2013, 07:24 PM
  6. [SOLVED] Recording macro totally ignores Conditional Formatting
    By yelsobky in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-24-2012, 05:57 AM
  7. Recording conditional formatting macro
    By ad9051 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-14-2011, 02:53 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