Thanks for reading this post!
I'm trying to delete a series of rows using a loop to go through a range of cells.
My code works on one sheet, however, when i want to "goto" another sheet it comes up with an error
Why is this? Or am i missing something?!
Thanks for your help
I'm trying to delete a series of rows using a loop to go through a range of cells.
My code works on one sheet, however, when i want to "goto" another sheet it comes up with an error

Code:
Private Sub CommandButton1_Click()
Dim i As Integer
For i = 2 To 6
Sheets("Sheet1").Activate
If ActiveSheet.Cells(i, 1) = "" Then
Sheets("Sheet2").Activate
ActiveSheet.Range(Cells(i, 4), Cells(i, 5)).Select ' ERROR IS ON THIS LINE?
Selection.Clear
End If
Next i
End Sub
Why is this? Or am i missing something?!
Thanks for your help
