Runtime error "6" Overflow.
Hello,
I am currently creating a macro that allows me to delete rows from a column. However, when I try to run it, the error message: "runtime error '6' Overflow." appears.
Here is my program.
Sub Button1()
Dim i As Integer
With ThisWorkbook.Sheets("Sheet1")
For i = .Range("B" & .Rows.Count).End(xlUp).Row To 2 Step -1
If .Range("B" & i).Value = "C00001" Then
.Rows(i).Delete
End If
Next i
End With
End Sub
Can you help me?
Thank you in advance
Configuration: Windows / Chrome 67.0.3396.87
I am currently creating a macro that allows me to delete rows from a column. However, when I try to run it, the error message: "runtime error '6' Overflow." appears.
Here is my program.
Sub Button1()
Dim i As Integer
With ThisWorkbook.Sheets("Sheet1")
For i = .Range("B" & .Rows.Count).End(xlUp).Row To 2 Step -1
If .Range("B" & i).Value = "C00001" Then
.Rows(i).Delete
End If
Next i
End With
End Sub
Can you help me?
Thank you in advance
Configuration: Windows / Chrome 67.0.3396.87
2 answers
-
Hello,
Integer: Whole number from -32768 to 32767
What number is your last line?-
-
-
-
-
Contributor@needhelpohoh, on which line do you have the mistake?
-