+ Reply to Thread
Results 1 to 7 of 7

VBA for Conditional Format

  1. #1
    Registered User
    Join Date
    06-05-2017
    Location
    US
    MS-Off Ver
    2013
    Posts
    33

    VBA for Conditional Format

    Hello,

    I need help acquiring a VBA that can make a list of all the red cells that I've conditionally formatted with a range. The cells I've conditionally formatted can turn red, green, or yellow. When one of the cells turns red (meaning it's out of a given range) I would like for it to be copied onto another list either at the bottom of the excel spreadsheet or on a new one, whichever I can get help with. An example of one of the ranges would be

    Red:
    =IF(AND(OR($B$4<0.001,$B$4>0.004),$B$4>0,$B$4<=18),TRUE,IF(AND(OR($B$4<0.003,$B$4>0.008),$B$3>18),TRUE))

    Green:
    =IF(AND(AND($B$4>0.001,$B$4<0.004),$B$3>0,$B$3<=18),TRUE,IF(AND(AND($B$4>0.003,$B$4<0.008),$B$3>18),TRUE))

    Yellow:
    =IF(AND(OR($B$4=0.001,$B$4=0.004),$B$3>0,$B$3<=18),TRUE,IF(AND(OR($B$4=0.003,$B$4=0.008),$B$3>18),TRUE))

    I've attached a reference spreadsheet. Any help would be appreciated.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    863

    Re: VBA for Conditional Format

    I'm really not sure what your asking. Are analyzing multiple cells to test if they are within your number from? Should we be checking all of Row 4? Or just cell B4 when it changes color? Are you trying to do this for mulitple worksheets or other?

    And if it turns red, what do you want copied below? Can you provide a before and after example?

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA for Conditional Format

    See if this is near to what you wanted:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Registered User
    Join Date
    06-05-2017
    Location
    US
    MS-Off Ver
    2013
    Posts
    33

    Re: VBA for Conditional Format

    Sorry I wasn't very clear the first time, but basically what I want is a VBA that can gather all the cells that turn red from the conditional formatting after the information is manually inputted. I would like for it to be able to copy the title of the cell, which should be in column A, into a designated area below the spreadsheet or if possible onto another spreadsheet. Here's a before and after example.
    Attached Files Attached Files

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA for Conditional Format

    Then maybe:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-05-2017
    Location
    US
    MS-Off Ver
    2013
    Posts
    33

    Re: VBA for Conditional Format

    Thanks for the help but this doesn't seem to be working for me.

  7. #7
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    863

    Re: VBA for Conditional Format

    Quote Originally Posted by pahickham View Post
    Thanks for the help but this doesn't seem to be working for me.
    What was wrong with it? I ran the code by xladept on your before sheet, and it gave the results shown in your after file. Is there something else it needs to do?

+ 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. Replies: 7
    Last Post: 03-24-2015, 07:44 AM
  2. Replies: 3
    Last Post: 02-24-2015, 02:58 AM
  3. Replies: 3
    Last Post: 05-15-2013, 12:16 AM
  4. [SOLVED] Copy Conditional Format only without over writing existing format
    By RobNorwichUK in forum Excel General
    Replies: 2
    Last Post: 01-22-2013, 12:20 PM
  5. Replies: 2
    Last Post: 09-26-2012, 04:43 AM
  6. Replies: 0
    Last Post: 05-20-2011, 02:33 PM
  7. Replies: 6
    Last Post: 08-02-2010, 04:05 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