BASIC syntax error. Unexpected symbol: End Sub

I’m a coding newbie. When running the following code i get error message BASIC syntax error. Unexpected symbol: End Sub.

I’m trying make a macro to shade every other row.

Sub altRows
Dim i as integer

for i = 8 to 1001

Range(Cells(i , 1), Cells(i , 4)).Interior.Color = RGB(255, 255, 255)
i=i+1


Range(cells(i , 1), Cells(i , 4)).Interior.Color = RGB(217, 217, 217)
i=i+1
exit for

End sub
REM  *****  BASIC  *****
option vbasupport 1

Sub altRows
    for i = 8 to 1001 step 2
        Range(cells(i , 1), Cells(i , 4)).Interior.Color = RGB(217, 217, 217)
    next
End sub

You never finished the For loop - it must end with Next.

ah thanks… now i get an BASIC runtime error.
Sub-procedure or function procedure not defined. on the line

Range(Cells(i , 1), Cells(i , 4)).Interior.Color = RGB(255, 255, 255)

This is unrelated to the “BASIC syntax error. Unexpected symbol: End Sub”. And you would need to provide more data, like if you use it with VBA support; if you have that code in a file module; and so on.

Please create a new question, and provide the necessary data there (better attach a sample file with the macro there).