ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find and Replace that contains some word (https://www.excelbanter.com/excel-programming/370415-find-replace-contains-some-word.html)

proton

Find and Replace that contains some word
 

Hello,
I would like to find and replace data in some column. Lets say in
column C.
But i have some problem....
The data in this column which i have to pepcace may contain some
aditional texts
For example :
I would like to replace .ACD with .ABC
in come cells .ACD have aditional texts .ADC Bookmark For You.
Is it possible to replace whole cell which Begins with .ADC with
..ABC??

I wrote this script but it doesnot work

Sub Replace()

Range("C").Replace What:=".ACD '*', Replacement:=".ABC"
End Sub


--
proton
------------------------------------------------------------------------
proton's Profile: http://www.excelforum.com/member.php...o&userid=36802
View this thread: http://www.excelforum.com/showthread...hreadid=571739


Bernie Deitrick

Find and Replace that contains some word
 
Sub NewReplace()
Range("C:C").Replace What:=".ACD", Replacement:=".ABC", lookat:=xlPart
End Sub

Or

Sub NewReplace()
Range("C:C").Replace What:=".ACD*", Replacement:=".ABC"
End Sub

Not sure which you wanted - try them on copies of your data.....

HTH,
Bernie
MS Excel MVP


"proton" wrote in message
...

Hello,
I would like to find and replace data in some column. Lets say in
column C.
But i have some problem....
The data in this column which i have to pepcace may contain some
aditional texts
For example :
I would like to replace .ACD with .ABC
in come cells .ACD have aditional texts .ADC Bookmark For You.
Is it possible to replace whole cell which Begins with .ADC with
ABC??

I wrote this script but it doesnot work

Sub Replace()

Range("C").Replace What:=".ACD '*', Replacement:=".ABC"
End Sub


--
proton
------------------------------------------------------------------------
proton's Profile: http://www.excelforum.com/member.php...o&userid=36802
View this thread: http://www.excelforum.com/showthread...hreadid=571739




proton

Find and Replace that contains some word
 

10xs a lot
Its working


--
proton
------------------------------------------------------------------------
proton's Profile: http://www.excelforum.com/member.php...o&userid=36802
View this thread: http://www.excelforum.com/showthread...hreadid=571739



All times are GMT +1. The time now is 01:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com