VBA code to return end of previous month (if cell is blank)
Experts,
How can I change the row rCell2.Value = Date - Day(Date) to return the end of the previous month if there is no data in the cell?
Right now, the code works as planned in all cases but returns a blank if the cell is blank.
Range(Selection, Selection.End(xlDown)).Select Dim rCell2 As Range For Each rCell2 In Selection If IsDate(rCell2) And Not rCell2.HasFormula Then rCell2.Value = Date - Day(Date) End If Next rCell2