Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Diane Collins   on Nov 09 In MS Office Category.

  
Question Answered By: Harriet Ward   on Nov 09

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

Share: 

 

This Question has 9 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Sequence field Or get search suggestion and latest updates.


Tagged: