+ Reply to Thread
Results 1 to 3 of 3

Conditional Formatting with overlapping ranges

  1. #1
    Registered User
    Join Date
    02-04-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    8

    Talking Conditional Formatting with overlapping ranges

    Hi everyone,

    I'm new to VBA programming, but with a lot of searching and studying code examples I have managed to make 3 working macros today. However I am stuck on the last one that I need to create. The aim is to have a macro that deletes and re-establishes our two conditional formatting rules on our sheet. The ranges overlap, and this seems to cause it the macro to stop working. If I run a version of the macro with either 1 rule at a time it works fine. If I run the whole thing with both rules, it gives a runtime error 438 and debug highlights the line ending xlDuplicate.

    Please Login or Register  to view this content.
    What changes can I implement to get this to work?

    Also, I was hoping someone could please explain to me how this line of code works?
    Please Login or Register  to view this content.
    Thank you in advance!!
    Last edited by electricninja; 02-04-2017 at 09:12 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Conditional Formatting with overlapping ranges

    Please Login or Register  to view this content.
    The .SetFirstPriority line makes a newly added condition the 1st condition. It's not really needed if you add them in the order you want them.
    Last edited by AlphaFrog; 02-04-2017 at 02:50 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    02-04-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    8

    Re: Conditional Formatting with overlapping ranges

    Hi AlphaFrog,

    Thank you so much for your fast response. I tested the code you provided and I'm very glad that it is now working!

+ 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 - Overlapping Time
    By StartRunMSPaint in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-30-2014, 10:24 AM
  2. Replies: 5
    Last Post: 12-04-2012, 09:48 AM
  3. Looking for Conditional Formatting formula to alert overlapping times
    By lzuke in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-17-2012, 01:08 PM
  4. Overlapping bars with conditional formatting
    By MI_Analyst in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-23-2012, 04:52 AM
  5. Replies: 3
    Last Post: 05-15-2012, 04:13 PM
  6. overlapping conditional formatting
    By Xtopher in forum Excel General
    Replies: 8
    Last Post: 09-21-2011, 12:47 AM
  7. Replies: 0
    Last Post: 07-03-2011, 07:52 PM
  8. [SOLVED] vba overlapping conditional formatting
    By Susan J-P in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-11-2006, 01:10 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