+ Reply to Thread
Results 1 to 3 of 3

Conditional formatting with VBA

  1. #1
    Registered User
    Join Date
    04-16-2012
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    2

    Conditional formatting with VBA

    Hi Guys,

    I'm new to VBA, so this problem might be not be really difficult, yet I cannot seem to find solution...

    I'll just list what I need to do:

    1. Conditional formatting needs to be applied to columns P and Q
    =$Q1>$P1=> both cells turn red;
    =AND($Q1=0,$P1>0) => both cells turn yellow.
    2. Formatting needs to be applied only to rows where cell R is not empty (or where cell C is empty)
    3. Number of total rows in range might be based on column B

    Problem is that my recorded macro works properly only if I specify first cell that formatting needs to be applied to e.g. $Q12>$P12. I have no idea how to solve this...

    I'm struggling with this long enough, can anybody help me?

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Conditional formatting with VBA

    You can do all that by formula based conditional formatting.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    04-16-2012
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Conditional formatting with VBA

    I understand, but the point is I need inside the macro, so that the report is final after running it. The formatting bit is just a part of bigger code.

+ 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. Formatting Cells with Date or Text Values in a Conditional Formatting Formula
    By Phil Hageman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2014, 09:36 AM
  2. Opening xlsm files with conditional formatting opens with removed conditional formatting
    By Martijn.Steenbakker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:38 AM
  3. Replies: 1
    Last Post: 09-20-2013, 06:23 PM
  4. Delete Conditional Formatting conditions but keep cell formatting - Excel 2010
    By tetreama in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2012, 08:28 PM
  5. Replies: 3
    Last Post: 05-15-2012, 04:13 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