Filling with Today's Date if Blank

  • Good afternoon!


    I am trying to fill blank cells in a column with today's date if they are blank. However, if there is a date, I would like that to stay as is.


    This is what I have but it errors:


    Dim lrB As Long
    lrB = ws1.Cells(Rows.Count, "I".End(xlUp).Row
    If Cells.Range("E2:E" & lrB) = "" Then
    Range("E2") = Date
    End If


    I have tried other ways but in vain.

  • Re: Filling with Today's Date if Blank


    I just tried this one and nothing happened:


    With Range("E2:E" & lrB)
    For i = 1 To lrB
    If i = "" Then
    Value = Date
    End If
    Next i
    End With

  • Re: Filling with Today's Date if Blank


    So far this one gave me a date but skipped over rows:


    For i = 2 To lrB
    If Worksheets("Sheet1").Cells(i, 5).Value = "" Then
    Cells(i, 5).Value = Date
    End If
    i = i + 1
    Next I

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!