Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Replace Loop

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Replace Loop

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

--
Regards,
Tom Ogilvy

"Darrell" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace - Replace with Blank Space Studebaker Excel Discussion (Misc queries) 4 April 3rd 23 10:55 AM
Find loop doesn't loop JSnow Excel Discussion (Misc queries) 2 June 24th 09 08:28 PM
Can I replace a ' at the beginning of a text cell using Replace Hilde Excel Discussion (Misc queries) 4 September 10th 07 06:22 PM
find and replace - replace data in rows to separated by commas msdker Excel Worksheet Functions 1 April 15th 06 01:00 AM
How can I use replace(alt+H) for mutiple items needing replace Gery Excel Worksheet Functions 1 June 15th 05 05:51 PM


All times are GMT +1. The time now is 08:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"