Excel filtering and sequential numbering

I’m a bit stuck trying to automate a manual Accounting process at the moment whereby cells are manually entered values that number column A values in contiguous order so they are processed as a batch.

In example, Column A Rows 1-5 = “1010”, Column B would equal 1. Rows 6-10 = 1011, Column B would equal 2.

Currently they do this by filtering Column A for the first value then autofilling down the same value in B, then repeating for each discreet value in Column A.

Any ideas how I could do that?

@robin.thakur

Create a variable str of string type and index of integer type and initialize string with string.Empty and integer with 0

Use for each row in excel activity

Inside that use if condition with currentrow.ByField("ColumnAName").ToString.Equals(str)

On then side do nothing and on else side use assign with index = index +1

After the if inside the loop only use write cell activity and give value as index and cell as currentrow.ByField("ColumnWhereIndexToBeWritten")

Cheers