mcintoshmc
Active Member
- Joined
- Aug 10, 2007
- Messages
- 277
I've been using this macro for years successfully. It basically enters the current date in a row in column L once a cell in column I is edited.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rInt As Range
Dim rCell As Range
Dim tCell As Range
Set rInt = Intersect(Target, Range("I:I"))
If Not rInt Is Nothing Then
For Each rCell In rInt
With rCell.Offset(0, 3)
.Value = Now
.NumberFormat = "mmm d, yyyy"
End With
Next
End If
End Sub
I now want to highlight a row if the date is within the current calendar week and I'm using the below formula.
=TODAY()-WEEKDAY(TODAY(), 3)=$L2-WEEKDAY($L2, 3)
It works only when the month date and year is in the cell located in column L. But, the macro above returns the date and time (6/8/2023 2:39:39 PM), and therefore leaves the formula inoperable.
I either need a formula that will work with the time included, or a different macro that will return only the date and not the time.
Since everything I know about Excel was learned from here, I figure I'd ask you beautiful people. Any assistance provided is appreciated. Thanks.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rInt As Range
Dim rCell As Range
Dim tCell As Range
Set rInt = Intersect(Target, Range("I:I"))
If Not rInt Is Nothing Then
For Each rCell In rInt
With rCell.Offset(0, 3)
.Value = Now
.NumberFormat = "mmm d, yyyy"
End With
Next
End If
End Sub
I now want to highlight a row if the date is within the current calendar week and I'm using the below formula.
=TODAY()-WEEKDAY(TODAY(), 3)=$L2-WEEKDAY($L2, 3)
It works only when the month date and year is in the cell located in column L. But, the macro above returns the date and time (6/8/2023 2:39:39 PM), and therefore leaves the formula inoperable.
I either need a formula that will work with the time included, or a different macro that will return only the date and not the time.
Since everything I know about Excel was learned from here, I figure I'd ask you beautiful people. Any assistance provided is appreciated. Thanks.