joey peanuts
New Member
- Joined
- Mar 20, 2011
- Messages
- 18
Excel 2007
This seems so simple - there must be something obvious I am missing.
Private Sub Worksheet_Activate()
Dim myCounter As Integer
myCounter = 9
If Range("A9").Value = "" Then
For Each cell In Worksheets("TAKE OFF").Range("VND_CHOSEN").Cells
If cell.Value = "Renewal" Then
If cell.Offset(0, 1).Value = "Series1" Then
Worksheets("RBA_RECT").Cells(myCounter, 1).Value = cell.Offset(0, -3).Value
myCounter = myCounter + 1
End If
End If
Next cell
End If
End Sub
The error shows up on the underlined line. I have test for cell.offset(0,-3). value. It returns the correct value.
Thank you
This seems so simple - there must be something obvious I am missing.
Private Sub Worksheet_Activate()
Dim myCounter As Integer
myCounter = 9
If Range("A9").Value = "" Then
For Each cell In Worksheets("TAKE OFF").Range("VND_CHOSEN").Cells
If cell.Value = "Renewal" Then
If cell.Offset(0, 1).Value = "Series1" Then
Worksheets("RBA_RECT").Cells(myCounter, 1).Value = cell.Offset(0, -3).Value
myCounter = myCounter + 1
End If
End If
Next cell
End If
End Sub
The error shows up on the underlined line. I have test for cell.offset(0,-3). value. It returns the correct value.
Thank you