Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find and Replace an Asterik in VBA

Status
Not open for further replies.

MyFlight

Technical User
Feb 4, 2002
193
Help,

I have a script I am writing and need to replace the Asteriks "*" with the value "99". I tried the following however it does not find the Asteriks.

Columns("A:A").Select
Selection.Replace What:="'*'", Replacement:="10", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False


Your help will be greatly appreciated.


 
And this ?
Columns("A:A").Replace What:="*", Replacement:="99", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Nope,

That just replaces everything!!!!
 
The What needs a tilde before searching for chars that could be taken for wildcard chars :

What:="~*"


Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top