My dataset consists of Dynamic set of rows and columns, that means I don't know the column range and row range before hand.
I want the column number for the last non zero element in a given range in a row.And I want the operation repeated for all
the rows simultaneously.
Hence I'm looking for a formula that could be copy pasted for the given range.
I'm currently using a simple loop shown below, which is obviously taking ages to execute
Note : i= column
K= row length.
For j = 2 To K
l = i + 1
Cells(j, i + 7).Select
l = l - 1
Loop Until Cells(j, l).Value = 1
Cells(j, i + 7).Value = Cells(1, l).Value - Cells(1, 2).Value + 1
If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines