View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default show date only if information entered in cell

Hi,

It's written to only work on column C (3)

If Target.Column = 3 Then

If you want to work on a different column change the 3 and the offset to 1
less than the column number. IF you want it to work on a number of columns
then that's a slight re-write

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("A:F")) Is Nothing Then
Application.EnableEvents = False
If Target.Value < "" Then
Cells(Target.Row, 1).Value = Date
Else
Cells(Target.Row, 1).Value = ""
End If
Application.EnableEvents = True
End If
End Sub

Mike

"digitalmuse" wrote:

which i believe is why the formula now is not working it worked up until row 3
now anything entered in column c after row 3 does not result in a date entry
in colum a

"Mike H" wrote:

Hi,

Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Target.Column = 3 Then
If Target.Value < "" Then
Target.Offset(, -2).Value = Date
Else
Target.Offset(, -2).Value = ""
End If
End If
End Sub

Mike

"digitalmuse" wrote:

I want to have the current date show up in the first row say A whenever
someone enters information in a row - in other words if there is data in
cell C4 then the current date should show up in row A4