+ Reply to Thread
Results 1 to 5 of 5

Undo Highlight Rule When Not Selected Row

  1. #1
    Forum Contributor
    Join Date
    02-26-2023
    Location
    Lousianna
    MS-Off Ver
    Microsoft 365
    Posts
    1,271

    Undo Highlight Rule When Not Selected Row

    Hi,

    On the Enter Payments sheet I have a highlight rule in cells D13:H50. When selecting any of the cells that have data the row is highlighted dark blue in VBA.

    How can this be disabled when selecting cells that don't have data in this range? Or selecting cells anywhere else on the sheet?

    Thank you

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,192

    Re: Undo Highlight Rule When Not Selected Row

    Add the following code in the Else part. You are using the named range HighlightRow in a conditional formatting rule to give the row number of the row you want to highlight. If you change it to 0 the rule will be False.
    Please Login or Register  to view this content.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    02-26-2023
    Location
    Lousianna
    MS-Off Ver
    Microsoft 365
    Posts
    1,271

    Re: Undo Highlight Rule When Not Selected Row

    Wow that is fantastic now. I really appreciate it.

  4. #4
    Valued Forum Contributor
    Join Date
    03-24-2020
    Location
    Thailand
    MS-Off Ver
    Office 2024
    Posts
    996

    Re: Undo Highlight Rule When Not Selected Row

    Just change the conditional formatting rule to:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If your Question is answered; please mark it SOLVED. If you are happy with a member's solution, say 'Thanks' and click the 'Star' to Add Reputation.

  5. #5
    Forum Contributor
    Join Date
    02-26-2023
    Location
    Lousianna
    MS-Off Ver
    Microsoft 365
    Posts
    1,271

    Re: Undo Highlight Rule When Not Selected Row

    Thank you @ORoos for your suggestion. The code that 6StringJazzer provided works very well so I will keep it that way.

+ 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] Highlight Current Row - Undo Function
    By Hood in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-25-2021, 04:02 PM
  2. rule to highlight a pattern
    By chop83 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-25-2016, 10:30 PM
  3. [SOLVED] VB Code to undo all selected sheets
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2016, 03:21 PM
  4. Highlight Cells rule
    By johnpz in forum Excel General
    Replies: 1
    Last Post: 03-28-2016, 07:16 PM
  5. [SOLVED] Conditional Rule to highlight
    By Jiptastic in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-29-2013, 01:03 PM
  6. Need to create rule for auto highlight
    By xyzco123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-21-2011, 07:16 AM
  7. How do I undo an action when multiple sheets are selected?
    By Jared in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11: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