Sean Bailey
Sean Bailey

Reputation: 375

VBA Run-time error 13

I have created a simple code however it keeps coming up with run time error 13. Does anyone know why this is happening?

Dim x As Integer
x = ActiveSheet.Range("ALL_PROJECTS").row
Rows("x:1048576").EntireRow.Delete
Range("A3").ClearContents
End If

Upvotes: 0

Views: 190

Answers (1)

Rory
Rory

Reputation: 34045

x is a variable so you need to concatenate it into the rows statement, or you are using the literal text "x":

Rows(x & ":1048576").EntireRow.Delete

Upvotes: 2

Related Questions