1) Strange seeing you asking questions around here
2) Whilst your algorithm appears logical, I did note the following:
Your FOR NEXT statement starts at the end and works backwards to zero.
Why don't you start at row 1, and work down to the last row. That way,
you can ensure that you always start at 1, and then when you get to the
next "SEQ(", you can chronologically add 1 to the result.
My pseudo-code:
Dim Number_Of_Rows as Integer
Dim i as Integer
Dim Seq_Number as Integer
' Determine number of rows containing data
Number_Of_Rows = Range(Selection, Selection.End(xlDown)).Select
Seq_Number = 1
For i = 1 to Number_Of_Rows
Range("A1").Offset(i,0).select
If Left(.selection.Formula, 4) = "seq(" Then
activecell.value = "seq(" & Seq_Number & ")"
Seq_Number = Seq_Number + 1
Else
End If
Next i