I am trying to come up with a macro to delete all rows of data starting with row two (1st row is a header row that I do not want to delete) on several worksheets within my document. The worksheet names are listed out specifically in my macro below. I was just playing around with the rows 2:6000 in the macro. I really want it to delete all rows of data starting with row 2 and going until the last row, each sheet listed could have a different number of rows on the sheet. I get a Compile error: Syntax error when I run it. Can someone tell me where I'm going wrong? I know where I'm getting my error, I just don't know how to fix it.
Sub DeleteRows()
Dim shtArr, i As Long
shtArr = Array("Not Covered", "No Run", "Not Completed", "Blocked", "Failed", "Not Testable", "Passed")
For i = LBound(shtArr) To UBound(shtArr)
Sheets(shtArr(i)).Rows(2:6000).EntireRow.Delete
Next i
End Sub
Sub DeleteRows()
Dim shtArr, i As Long
shtArr = Array("Not Covered", "No Run", "Not Completed", "Blocked", "Failed", "Not Testable", "Passed")
For i = LBound(shtArr) To UBound(shtArr)
Sheets(shtArr(i)).Rows(2:6000).EntireRow.Delete
Next i
End Sub