+ Reply to Thread
Results 1 to 4 of 4

Cond Formatting - dynamic applied range on template

  1. #1
    Registered User
    Join Date
    10-10-2020
    Location
    Oregon, USA
    MS-Off Ver
    365
    Posts
    2

    Cond Formatting - dynamic applied range on template

    Is there a way to make the 'applies to' range dynamic to include all rows with data?

    I have a template that people grab and make a copy each time they do a job. There is a macro that populates the 'working' sheet based on data in other sheets. So in the template, there is no data (other than header row) on the working sheet, but it does have conditional formatting. Right now, i have the applied range for the formatting set to the first 2500 rows ($2:$2500) but this is not ideal, most jobs require far fewer lines, maybe 400-1,000. On rare occasions, there may be a job that requires more than 2500 lines.

    Can i put something in the 'applies to' field that will be a cleaner / more efficient way to get the cond formatting where it is needed and not have it applied needlessly?

    Is there a reason (performance?) not to just apply the cond formatting to rows 2-10,000 even though i'll never need 10,000 lines? Possibly related is that i'm trying to keep the vertical scroll bar to the range of actually used cells, rather than scrolling down taking me to the 1 millionth row or whatever, which is often happens for reasons i haven't yet been able to pin down.

    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
    44,383

    Re: Cond Formatting - dynamic applied range on template

    You can enter a Dynamic Named Range in the Applies to box ... but Excel immediately converts it to an absolute range (in my testing).

    You shouldn't use excessive Conditional Formatting if you can avoid it as it WILL have a performance hit depending on the number and complexity of conditions. Note that deleting and inserting rows and/or columns can split the CF rules up and, over time, this can have a serious performnce hit.

    You could make your data area into a Structure Table and have as many or as few rows in the Table as you like. Formatting, CF and formulae are automatically copied to new rows, so that might work for you.
    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
    Registered User
    Join Date
    10-10-2020
    Location
    Oregon, USA
    MS-Off Ver
    365
    Posts
    2

    Re: Cond Formatting - dynamic applied range on template

    Quote Originally Posted by TMS View Post
    You can enter a Dynamic Named Range in the Applies to box ... but Excel immediately converts it to an absolute range (in my testing).
    Yes, i meant to start by saying that I'm sure this question has been addressed and i DID spend a fair amount of time googling it but did not find a solution. I did read of others who had this same experience.

    You shouldn't use excessive Conditional Formatting if you can avoid it as it WILL have a performance hit depending on the number and complexity of conditions. Note that deleting and inserting rows and/or columns can split the CF rules up and, over time, this can have a serious performnce hit.
    I suspected that and have run into some performance issues on these sheets so i'm trying to do things the best way possible.

    You could make your data area into a Structure Table and have as many or as few rows in the Table as you like. Formatting, CF and formulae are automatically copied to new rows, so that might work for you.
    I hadn't heard of a structure table, i'll look into that, thanks.

  4. #4
    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
    44,383

    Re: Cond Formatting - dynamic applied range on template


+ 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] macro to trigger Cond Formatting when just CLICK on any cell in a range
    By MannStewart in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-24-2020, 03:30 AM
  2. [SOLVED] Populate Texbox based from Combobox selection having applied dynamic range and adv filter
    By Amita68 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-23-2017, 03:23 PM
  3. Conditional formatting (icons) applied to a range using formulas
    By daveh0 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-25-2017, 10:47 AM
  4. Conditional Formatting time with a range applied
    By andyp24 in forum Excel General
    Replies: 7
    Last Post: 07-20-2016, 03:51 AM
  5. [SOLVED] Conditional formatting if A1 in sheet1 is not = A1 in sheet2 applied to a range
    By Mattlawson in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-09-2015, 09:10 PM
  6. [SOLVED] Cond. formatting a column/Range, highlight cell in column/range if equal to specific text
    By DFrank231 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-19-2013, 03:35 PM
  7. [SOLVED] SumIF applied to a dynamic range
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-24-2013, 11:56 AM

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