Evening ladies & gents,
I got this piece of code used to run fine but I started getting the above message.
Sub DetermineRisk()
Dim i As Integer
Dim MyLastRow As Long
Dim MyVar As Double
Dim MyChange As Double
ThisWorkbook.Activate
For i = 4 To ActiveWorkbook.Worksheets.Count
Sheets(i).Activate
MyLastRow = Cells(Application.Rows.Count, 16).End(xlUp).Row
MyVar = Cells(MyLastRow, 16).Offset(-1, 0)
MyChange = Cells(MyLastRow, 16).Offset(0, 0)
If Abs(MyVar) > 25000000 And Abs(MyChange) > 0.1 Then
ActiveWorkbook.Sheets(ActiveSheet.Name).Tab.ColorIndex = 3
Else
ActiveWorkbook.Sheets(ActiveSheet.Name).Tab.ColorIndex = 4
End If
Next i
End Sub
The colored rows are the ones that have the issue.
Im guessing it has something to do with the Cells reference.
Any assistance would be much appreciated.
Cheers
Bookmarks