+ Reply to Thread
Results 1 to 6 of 6

Add range to Conditional Formatting

  1. #1
    Registered User
    Join Date
    03-23-2015
    Location
    UK
    MS-Off Ver
    2016
    Posts
    27

    Add range to Conditional Formatting

    I already have conditional formatting set on a table column, can I add to the range without duplicating it through VBA?

    I've tried copying and pasting the format to the additional range, but that just creates a new instance of the condition.


    Any help would be greatly appreciated.

    Thanks.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,951

    Re: Add range to Conditional Formatting

    In the Applies to box, use, for example:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    That is, separate ranges with a comma (,)

    To continue the example:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Add range to Conditional Formatting

    Tables should copy down conditional formatting automatically. You have to "clear" all other conditional formatting out. Tables work on the principle of "if everything above me has the same thing, then I'll copy it down."
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  4. #4
    Registered User
    Join Date
    03-23-2015
    Location
    UK
    MS-Off Ver
    2016
    Posts
    27

    Re: Add range to Conditional Formatting

    Via vba TMS...

    I have code that automatically inserts columns at the end of each working day.
    Removing the current conditional formatting for the columns and re-applying them after a certain length of time may become quite intensive...

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,951

    Re: Add range to Conditional Formatting

    Sorry, can't second guess what your workbook, worksheets, tables, data, formatting and existing code looks like.

    How do you want to proceed?

  6. #6
    Registered User
    Join Date
    03-23-2015
    Location
    UK
    MS-Off Ver
    2016
    Posts
    27

    Re: Add range to Conditional Formatting

    In Excel, setup a table column with a conditional format assigned to it (eg. "=TRUE", colour it BLUE).

    Now in VBA, insert a new column. Is it possible to add the new column to the conditional format "Applies To" range without duplicating it?

    Here is the code I am currently using:
    Please Login or Register  to view this content.
    It duplicates the Conditional Formatting instead of just adding it to the "Applies To".

    Is it possible to do something like:
    Please Login or Register  to view this content.
    Last edited by pizzaboyuk; 05-26-2018 at 01:50 AM.

+ 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 one range containing text from another range
    By thedeakster in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-01-2013, 05:00 PM
  2. Replies: 3
    Last Post: 08-13-2013, 09:44 AM
  3. Conditional Formatting via VBA: Change formatting in range based on value of each cell
    By ralphjmedia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2013, 10:37 AM
  4. [SOLVED] Applying Conditional Formatting to a Range in VBA (range is set by variables)
    By JungleJme in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-12-2013, 08:32 AM
  5. Conditional Formatting - Grey Out and Lock A range based on a cell value in that range
    By Excelgnome in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2012, 07:31 PM
  6. COnditional Formatting with a Range
    By Krazyolman in forum Excel General
    Replies: 3
    Last Post: 10-01-2011, 02:34 PM
  7. Replies: 2
    Last Post: 10-06-2005, 03:05 PM
  8. Replies: 3
    Last Post: 03-02-2005, 08:06 AM

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