
Signature
Don Guillett
SalesAid Software
dguillett1@austin.rr.com
It is not as straight-forward as that.
I want to find all instances in a block of text contained in sheet 2 ,of the
value in cell A1, sheet 1, and replace it with the value from cell B1 sheet
1.
e.g
A1 B1
xxx yyy
A2 B2
aaa bbb
A3 B3
ccc ddd
text in sheet 2...
field b0 @avg ("xxx" , DATEFIRST, DATELAST) ;
field B0 b0 write xxx
field b2 @avg ("ccc" , DATEFIRST, DATELAST) ;
field B2 b2 write ccc
text after replacements...
field b0 @avg ("yyy" , DATEFIRST, DATELAST) ;
field B0 b0 write yyy
field b2 @avg ("ddd" , DATEFIRST, DATELAST) ;
field B2 b2 write ddd
If you notice, in the original text, there was no text string "aaa", so I
want the code the continue throught the list and search for "ccc" without
falling over as it found no instances of "aaa".
Sorry if wasn't clear before....
Thank you,
Bhupinder.
> the macro recorder is your friend
> Sub Macro5()
[quoted text clipped - 33 lines]
> >
> > Bhupinder
Don Guillett - 24 Jan 2006 13:44 GMT
try this loop
Sub findreplaceloop()
For Each c In Sheets("sheet7").Range("d1:d2")
Sheets("sheet6").Range("f1:f4").Replace What:=c, Replacement:=c.Offset(, 1),
_
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Next c
End Sub

Signature
Don Guillett
SalesAid Software
dguillett1@austin.rr.com
> It is not as straight-forward as that.
>
[quoted text clipped - 79 lines]
>> >
>> > Bhupinder