
Originally Posted by
ferrari2005
Hi guys,
First of all I'm not a programmer! I've been using the record macro facilty to create a macro to find and replace text. The code it generates is as follows:
Cells.Replace What:="ABCDEF", Replacement:="GHIJKL", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:= _
False, ReplaceFormat:=False
I'm looking to run this code in column A only. However, it looks like if the search string exists in another column, the other column changes but not Column A.
How would I limit the code to a specific column or is there better coding for what I'm after?
Cheers
Roy
A quick run of 'record macro' (one of my favourites too) shows
Columns("A:A").Select
Selection.Replace What:="dot", Replacement:="comma", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
suggests you use 'selection' after selecting "A:A"
Does this help?
---
Bookmarks