+ Reply to Thread
Results 1 to 9 of 9

color row if there is a date

  1. #1
    Forum Contributor
    Join Date
    08-27-2019
    Location
    europa
    MS-Off Ver
    excel 2007
    Posts
    483

    color row if there is a date

    Hi everyone.
    in the attached workbook sheet2 must highlight the row if there is a date in column P
    now the color of the row changes if I click in the cell.
    It has to do this if I move between the two sheets
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    929

    Re: color row if there is a date

    You could use Conditional Formatting: Formula: =$P5>1 and apply it to the whole area: =$A$5:$P$105
    Difficult is not to know but to share what you know (Han Fei Tzu reworked)

  3. #3
    Forum Contributor
    Join Date
    08-27-2019
    Location
    europa
    MS-Off Ver
    excel 2007
    Posts
    483

    Re: color row if there is a date

    Thanks you rollis13, but I have to use a macro

  4. #4
    Forum Contributor
    Join Date
    08-27-2019
    Location
    europa
    MS-Off Ver
    excel 2007
    Posts
    483

    Re: color row if there is a date

    Change the macro because it works with

    Private Sub Worksheet_Activate()


    now it doesn't work

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    929

    Re: color row if there is a date

    This was the solution I was going to suggest with the Worksheet_Activate event, but I gave up as it doesn't delete any highlighting that is no longer needed:
    Please Login or Register  to view this content.
    But you can try this with this tweak:
    Please Login or Register  to view this content.
    Last edited by rollis13; 05-13-2024 at 04:36 PM.

  6. #6
    Forum Contributor
    Join Date
    08-27-2019
    Location
    europa
    MS-Off Ver
    excel 2007
    Posts
    483

    Re: color row if there is a date

    Thanks rollis it works well.

    I added 4 lines

    If UCase(Trim(cell.Value)) = "" Then
    Me.Range("A" & cell.Row & ":P" & cell.Row).Validation.Delete
    Me.Range("A" & cell.Row & ":P" & cell.Row).Interior.Color = xlNone
    End If

    but for this

    Me.Range("A" & cell.Row & ":P" & cell.Row).Interior.Color = xlNone

    I have to switch between 2 sheets twice

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    929

    Re: color row if there is a date

    Please consider my second suggestion in post #5.

  8. #8
    Forum Contributor
    Join Date
    08-27-2019
    Location
    europa
    MS-Off Ver
    excel 2007
    Posts
    483

    Re: color row if there is a date

    Thank you, rollis13, work well
    Last edited by xam99; 05-14-2024 at 03:43 AM.

  9. #9
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    929

    Re: color row if there is a date

    Thanks for the positive feedback, glad having been of some help.
    By the way, you probably need to mark this thread as [Solved].

+ 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. Replies: 3
    Last Post: 09-07-2022, 09:31 AM
  2. Replies: 5
    Last Post: 03-29-2022, 10:52 AM
  3. Replies: 5
    Last Post: 01-05-2015, 03:57 PM
  4. [SOLVED] VBA Macro to Color Row Text If Date in Cell is greater than system date
    By slick9456 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-24-2014, 06:09 PM
  5. Macro to Change color of cell after cross referencing date with a given date.
    By liajet24 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-24-2013, 12:33 PM
  6. Color Code Actual Date versus Due Date ( Red, Yellow, Green )
    By Bfisher74 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-28-2013, 10:10 AM
  7. Color fill a cell and then remove the color when a date is added.
    By texas tornado in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-25-2012, 02:14 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