Need today's date to auto fill in a cell when data is entered into another cell

I would like to have cells C5-C39 auto fill today's date whenever data is entered into cells B5-B39.

I have tried to get it to work using =TODAY() but don't how to structure the formula.


Solution 1:

The following puts today's date in cell "B" whenever there is a change in cell "A":

Private Sub Worksheet_Change(ByVal Target As Range)
' Auto Date
Dim Cell As Range
For Each Cell In Target
    If Cell.Column = Range("A:A").Column Then
        If Cell.Value <> "" Then
            Cells(Cell.Row, "B").Value = Int(Now)
        Else
            Cells(Cell.Row, "B").Value = ""
        End If
    End If
Next Cell
End Sub

This code needs to be placed in the VBA module for the worksheet where you want this behavior to occur.

Solution 2:

You can do this without VBA. I needed my C column to fill in with today's date based on the B column have a value entered. This formula works to get it inserted correctly.

=IF(ISBLANK(B2)," ",NOW())

I placed this in the C2 cell since that is where I was starting for my C column. You can place this in whichever column's cell you're starting in. Then just make sure that my B2 reference is replaced with the column and cell your value is being entered into. For example, if your kick-off cell is F3, you should change the formula to say

=IF(ISBLANK(F3), " ",NOW()). 

And if your corresponding date cell is K3, place formula there. (You can drag the formula to the rest of the column's cells once it's in the first one.)

This formula keeps the date cells empty until the "kick-off" cell has a value entered. Once that value is entered, the date is added. If the value is deleted, Excel will automatically remove the date. So it's not perfect, but if you need something more sophisticated, you probably need an Excel expert or a program that's handling this for you.