View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Joe Clarke Joe Clarke is offline
external usenet poster
 
Posts: 1
Default Static date not working using VBA

I am trying to insert a static date into column P (from p7 down) if the adjacent column is populated. I need it to remain blank otherwise and the O column is a select-able drop down list.
the code I'm trying to use is as follows but it wont seem to work.
can anyone please advise

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("O7:O50000")) Is Nothing Then
With Target(1, 2)
.Value = Date
.EntireColumn.Autoit
End With
End If
End Sub