Tuesday, April 28, 2009

VBA Replace Method

I've been using the Replace method a lot lately.  Wanted to get it up and front.  The first time I used it, I found someone who had re-programmed it -- so I have some useless code in one of my projects.

Instead of doing a big writeup, here are examples from

------ CODE -------
Replace("alphabet", "bet", "hydro") would return "alphahydro" 
Replace ("alphabet", "a", "e") would return "elphebet" 
Replace("alphabet", "a", "e", 2) would return "lphebet" 
Replace("alphabet", "a", "e", 1, 1) would return "elphabet"
---- END CODE

No comments:

Post a Comment