View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Colin Hayes Colin Hayes is offline
external usenet poster
 
Posts: 465
Default Fixing date of entry

In article , Gord Dibben
writes
Revised code..........note only 6 columns.........you can fill in the rest<g

There is probably a better method of defining the range but this works.

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Range)
On Error GoTo enditall
Application.EnableEvents = False
If Intersect(Range(Target(1).Address), _
Range("B:B, D:D, F:F, H:H, J:J, L:L")) _
Is Nothing Then GoTo enditall
With Target
If .Value < "" Then
With .Offset(0, -1)
.Value = Date
.Columns.AutoFit
End With
Else: .Offset(0, -1).Value = ""
End If
End With
enditall:
Application.EnableEvents = True
End Sub


Gord




Hi Gord

OK thanks again for this. It's working perfectly first time.

Grateful for your time and expertise.

Best Wishes