Results 1 to 5 of 5

Thread: Format line based on condition

  1. #1
    VBAX Mentor Sir Babydum GBE's Avatar
    Joined
    Mar 2005
    Location
    Cardiff, UK
    Posts
    499
    Location

    Format line based on condition

    Hi

    How can I make the entire row bold if the date in column J matches today's date? (Date format in J is "ddd, dd mmm yy" if it's important)

    I can't use conditional formatting because need formats to remain after condition has changed. (Basically the bold lines highlight the additions I make today, but the report I send may not be opened on the same day)

    Many thx

    BD
    Have a profound problem? Need a ridiculous solution? Post a question in Babydum's forum

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,446
    Location
    Could you not make the CF dependent upon the date?

    =J2=TODAY()
    Last edited by Aussiebear; 06-20-2025 at 03:20 AM.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Mentor Sir Babydum GBE's Avatar
    Joined
    Mar 2005
    Location
    Cardiff, UK
    Posts
    499
    Location
    Quote Originally Posted by xld
    Could you not make the CF dependent upon the date?

    =J2=TODAY()
    Is not possible Bob because...

    At close of business I send a report with additions I made this day bolded to stand out. But the report isn't usually opened by the addressee on the same day, so the formatting would disappear before they opened it.
    Last edited by Aussiebear; 06-20-2025 at 03:20 AM.
    Have a profound problem? Need a ridiculous solution? Post a question in Babydum's forum

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,446
    Location
    Sorry, mis-read what you had written.

    Do you want to bold the row when J changes and it is today, or whenever the value in J matches today's date?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Mentor Sir Babydum GBE's Avatar
    Joined
    Mar 2005
    Location
    Cardiff, UK
    Posts
    499
    Location
    Quote Originally Posted by xld
    Sorry, mis-read what you had written.

    Do you want to bold the row when J changes and it is today, or whenever the value in J matches today's date?
    No worries.
    Actually - I got it! (by research - not brains).
     
    Sub BoldToday()
        Dim i As Long
        Dim MyNew As Long
        Application.ScreenUpdating = False
        LR = Cells(Rows.Count, 1).End(xlUp).Row
        For i = MyNew To 2 Step -1
            If Range("J" & i).Value = Date Then
                Range("J" & i).EntireRow.Font.Bold = True
            End If
        Next i
        Application.ScreenUpdating = True
    End Sub
    Last edited by Aussiebear; 06-20-2025 at 03:21 AM.
    Have a profound problem? Need a ridiculous solution? Post a question in Babydum's forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •