Euro5
asked on
VBA overflow runtime error 6
I am getting runtime error 6.
Overflow
I panic here, can anyone help?
Overflow
I panic here, can anyone help?
Sub delbadzones()
Dim Max As Integer
Dim Row As Integer
Max = Cells(ActiveSheet.Rows.Count, 1).End(xlUp).Row
For Row = Max To 2 Step -1
Cells(Row, 1).Select
Select Case UCase(Cells(Row, 1).Value)
Case "GR", "HD", "MWT"
If Cells(Row, 3).Value < 2 Or Cells(Row, 3) > 8 Then
Cells(Row, 1).EntireRow.Delete
End If
End Select
Next Row
End Sub
Which line gives the error? BTW you don't need line 8.
ASKER
Line 5
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if that's the case then Row will need to be declared as Long as well.You're absolutely right.
ASKER
Now running - thanks!
You're welcome and I'm glad I was able to help.
In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015
In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015