LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Find/Replace text with formula

They all worked for me.


--
Regards,
Tom Ogilvy


"Jasmine" wrote:

Thank you! That worked.

"Gary Keramidas" wrote:

maybe something like this, just adjust the range in column j

Sub test()
Dim cell As Range
For Each cell In Range("j1:j100")
cell.Replace What:="0", Replacement:="=(E" & cell.Row & "+F" & cell.Row & _
"+G" & cell.Row & "+H" & cell.Row & ")-I" & cell.Row, LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
Next
Range("J5").Select
End Sub

--


Gary


"Jasmine" wrote in message
...
I have a spreadsheet with a column that has the value 0 in some cells. I want
to write a macro to do a search for column J and every time it finds 0 it
puts my formula in there. I got it to put the formula in there, but not
adjust for what row it is on.

Columns("J:J").Select
Selection.Replace What:="0", Replacement:="=(E3+F3+G3+H3)-I3", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
Range("J5").Select

This works fine for row 3, but for row 5 it should put =(E5+F5+G5+H5)-I5. I
know there is an easy way to do this, but it is eluding me right now. Any
help would be greatly appreciated! Thanks!






 
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 & replace with text Waheeda Ali Excel Discussion (Misc queries) 2 January 27th 09 06:52 PM
Replace can't find text dac Excel Discussion (Misc queries) 1 October 26th 07 10:26 PM
find text in cell and replace it with part of the text in that ce. jules Excel Discussion (Misc queries) 3 May 3rd 07 10:18 AM
Find & Replace in Text Box Ed Excel Discussion (Misc queries) 10 March 28th 07 03:03 AM
Find and Replace Text Jim Thomlinson[_3_] Excel Programming 3 October 25th 04 10:01 PM


All times are GMT +1. The time now is 05:28 AM.

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

About Us

"It's about Microsoft Excel"