Hi,
Two questions.
1. When using the replace method, what does LookAt do/mean? The only documentation I can find tells me to use either xlPart or xlWhole but doesn't say what these things mean.
2. I'm trying to search for "(" and replace it with " (" for all the cells in my active worksheet. Here's my code:
Sub cleanuptext()
Cells.Select
Selection.Replace What:="T.Rowe", Replacement:="T. Rowe", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Cells.Select
Selection.Replace What:="(", Replacement:=" (", LookAt:=xlPart, MatchCase:=False
When my LookAt is xlWhole, I don't get errors, but it doesn't do the replacement. When my LookAt is xlPart, I get this error:
"The formula you typed contains an error..."
Any ideas?
TIA, Susie
End Sub
Two questions.
1. When using the replace method, what does LookAt do/mean? The only documentation I can find tells me to use either xlPart or xlWhole but doesn't say what these things mean.
2. I'm trying to search for "(" and replace it with " (" for all the cells in my active worksheet. Here's my code:
Sub cleanuptext()
Cells.Select
Selection.Replace What:="T.Rowe", Replacement:="T. Rowe", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
Cells.Select
Selection.Replace What:="(", Replacement:=" (", LookAt:=xlPart, MatchCase:=False
When my LookAt is xlWhole, I don't get errors, but it doesn't do the replacement. When my LookAt is xlPart, I get this error:
"The formula you typed contains an error..."
Any ideas?
TIA, Susie
End Sub