mcintoshmc
Active Member
- Joined
- Aug 10, 2007
- Messages
- 277
I'm using this VBA, and it worked perfectly the first day, but over the weekend I came back to work, and it only works in the cells towards the bottom of the sheet, but not those on the top. I have no idea why it's doing that.
Basically, column O is a notes column. Once I make a change in said column, it enters the date in column Z. I have conditional formatting which will color the entire row.
Can anyone tell me why it is only working in some rows, but not all? The range does say "O:O", so not sure whats happening.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rInt As Range
Dim rCell As Range
Dim tCell As Range
Set rInt = Intersect(Target, Range("O:O"))
If Not rInt Is Nothing Then
For Each rCell In rInt
Set tCell = rCell.Offset(0, 11)
If IsEmpty(tCell) Then
tCell = Now
tCell.NumberFormat = "mmm d, yyyy hh:mm"
End If
Next
End If
End Sub
Basically, column O is a notes column. Once I make a change in said column, it enters the date in column Z. I have conditional formatting which will color the entire row.
Can anyone tell me why it is only working in some rows, but not all? The range does say "O:O", so not sure whats happening.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rInt As Range
Dim rCell As Range
Dim tCell As Range
Set rInt = Intersect(Target, Range("O:O"))
If Not rInt Is Nothing Then
For Each rCell In rInt
Set tCell = rCell.Offset(0, 11)
If IsEmpty(tCell) Then
tCell = Now
tCell.NumberFormat = "mmm d, yyyy hh:mm"
End If
Next
End If
End Sub