View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
nabanco nabanco is offline
external usenet poster
 
Posts: 59
Default Auto fill today's date

Mike, is there a way to delete the date in the event there is nothing in
column B?

"Mike H" wrote:

Hi,

Right click the sheet tab, view code and paste this in.

Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Count 1 Then Exit Sub
If Not Intersect(Range("B1:B16"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 1).ClearContents
Else
With .Offset(0, -1)
.NumberFormat = "dd mm yy"
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
End Sub

Mike

"nabanco" wrote:

Hello,

How would I alter the below to put today's date in column A if a word is
entered into column B? For example, when "tower" is typed into B16, A16
automatically puts todays date in 07/07/07 format?

Thanks for your help