ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Search and Replace help (https://www.excelbanter.com/excel-programming/326568-search-replace-help.html)

hodeware

Search and Replace help
 
Can someone tell me what's wrong with my code? I am trying to search/replace
several text strings with one macro. Is this possible?

Columns("S:S", "BA:BA").Select
Selection.Replace What:="accuracy", Replacement:="accuracy1"
Selection.Replace What:="XS_EXOFF", Replacement:="XS_EXOFF1"
xlPart , SearchOrder:=xlByRows, MatchCase:=False,
SearchFormat:=False, _
ReplaceFormat:=False

Thanks-

Jim Thomlinson[_3_]

Search and Replace help
 
Try this...

Union(Range("S:S"), Range("BA:BA")).Select
Selection.Replace What:="accuracy", Replacement:="accuracy1"
Selection.Replace What:="XS_EXOFF", Replacement:="XS_EXOFF1"

HTH

"hodeware" wrote:

Can someone tell me what's wrong with my code? I am trying to search/replace
several text strings with one macro. Is this possible?

Columns("S:S", "BA:BA").Select
Selection.Replace What:="accuracy", Replacement:="accuracy1"
Selection.Replace What:="XS_EXOFF", Replacement:="XS_EXOFF1"
xlPart , SearchOrder:=xlByRows, MatchCase:=False,
SearchFormat:=False, _
ReplaceFormat:=False

Thanks-



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

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