Hi-
I prefer working on a mac, so I that is where I wrote the VBA code below on MS Excel 2011 for Mac. However, when I transferred the file over to my Windows 7 computer with Excel 2007, it did not work.
I have no idea why.
Here is the code for the event:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("M153:M113")) Is Nothing Then
With Target(1, -1)
.Value = Date
.EntireColumn.AutoFit
End With
End If
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("E13:E113")) Is Nothing Then
With Target(1, -1)
.Value = Date
.EntireColumn.AutoFit
End With
End If
End Sub
Essentially, the even works like this: If you enter something in column E or M then the date you made the entry is recorded respectively in column C or K. The date does not update.
As I said, this works perfectly on 2011 for Mac, not at all for my 2007 on Windows. Moreover, I checked to see that the code was still intact on "Sheet 1", and it was.
Any ideas?
Bookmarks