View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default FASTER USE OF THE REPLACE() FUNCTION !!!!!

You don't have to loop the range... you can apply the range's Replace method
to the entire range all at once...

Range("B3:B65500").Replace "-", ","

--
Rick (MVP - Excel)



"JLGWhiz" wrote in message
...
Would this not work:

For Each rng In Range("B3:B65500")
rng.Replace "-", ","
Next rng




"jay dean" wrote in message
...
Hi -

I am using the Replace() function for a very large range. It works okay
but wait time is quite long. Is there a more elegant approach to the
below?

For Each rng In Range("B3:B65500")
If rng.Value < "" Then
rng.Value = Replace(rng.Value, "-", ",")
End If
Next rng


Any help would be appreciated! Thanks

Jay

*** Sent via Developersdex http://www.developersdex.com ***