I am using this code to auto populate a date field
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("E19:E52")) Is Nothing Then
With Target(1, -1)
.Value = Date
.EntireColumn.AutoFit
End With
End If
End Sub
What it does: when I put data into any cell in the E19:E52 range, it places todays date into the corresponding row in column C.
I first wrote this code for a file at work (on a Windows PC) and it works like a dream... no problems. I copied & pasted the code to use for a file at home (on a MAC running OS X) and it just doesn't work. Fails everytime.
Any MAC people out there have a clue what the coding difference is???
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("E19:E52")) Is Nothing Then
With Target(1, -1)
.Value = Date
.EntireColumn.AutoFit
End With
End If
End Sub
What it does: when I put data into any cell in the E19:E52 range, it places todays date into the corresponding row in column C.
I first wrote this code for a file at work (on a Windows PC) and it works like a dream... no problems. I copied & pasted the code to use for a file at home (on a MAC running OS X) and it just doesn't work. Fails everytime.
Any MAC people out there have a clue what the coding difference is???