+ Reply to Thread
Results 1 to 4 of 4

Use vba to keep conditional format ranges even when rows deleted?

  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    954

    Use vba to keep conditional format ranges even when rows deleted?

    Hello,

    I have a workbook that has several conditional formats that extend down 2500 rows. If I use a macro to delete rows and condense data the conditional format range changes. Is there anyway to maintain the ranges through vba even when rows are removed? Ideally I'd like to keep this range for all conditional formatting: Thank you!conditional format.jpg
    Attached Files Attached Files
    Last edited by lilsnoop; 11-01-2020 at 03:45 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Use vba to keep conditional format ranges even when rows deleted?

    Hi

    If you defined your 'Applies to' range as entire columns, =e.g. =$A:$D
    ..then you wouldn't have to worry about rows being deleted or inserted.

    Of course, you might need to amend your formula to ignore row 1 etc etc etc

    zeddy

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Use vba to keep conditional format ranges even when rows deleted?

    I was going to say the same thing but based on those rules, they won't fire for row 1 anyway.

  4. #4
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    954

    Re: Use vba to keep conditional format ranges even when rows deleted?

    Excellent suggestion! Thank you both for your input!

+ 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. Macro to allow for inserting rows & maintain conditional format ranges
    By spenlinhauer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2015, 01:38 AM
  2. [SOLVED] Conditional Format for Date Ranges in Calendar
    By Oliver Vistisen in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-13-2013, 08:09 AM
  3. Conditional format within several ranges.
    By Marcel1983 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-31-2012, 07:53 AM
  4. Conditional format using ranges
    By thewrathful in forum Excel General
    Replies: 5
    Last Post: 03-27-2010, 01:20 PM
  5. cell ranges, conditional format 2008
    By winc in forum Excel General
    Replies: 2
    Last Post: 01-20-2009, 12:10 PM
  6. Conditional Format based on date ranges
    By Corey in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-31-2006, 12:40 AM
  7. [SOLVED] shading alternate rows, but losing format when one row is deleted
    By Candice in forum Excel General
    Replies: 8
    Last Post: 05-10-2006, 11:10 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