Replace Loop

  • Thread starter Thread starter Darrell
  • Start date Start date
D

Darrell

I am looking for helping in creating a loop that will
replace part of a formula in selected cells with the next
sequential number.
Ie. If the cell formula is =B4 then replace it with B5.
The selection will have a variety of columns, but the row
will always be the same.
I then want to print and do the replace again for the
next row of data.

Thank you for your assistance.

Darrell
 
I suspect the real formula is more complex than =B4. If so, it would be
easier to use another cell that holds the row number, then rather than using
=B4
use
=Indirect("B"&z1)

where z1 holds the value 4.

or instead of sum(B4:B100) use sum(Indirect("B" & Z1 & ":B100")

Then all you need to do is update the value in Z1

range("Z1").Value = Range("Z1").Value + 1
 
Back
Top