View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Replace in VBA Excel

Maurice,

Replace was added to VBA in version 6, or Excel 2000, so it is not
available in earlier versions. In its place, you can use

Result = Application.WorksheetFunction.Substitute(...)

to call the SUBSTITUTE worksheet function from within VBA. See
help in Excel for SUBSTITUTE for syntax details.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Maurice" wrote in message
...
In Visual basic you can use the Replace function to remove
unwanted characters. What would you use in VBA tom
accomplish the same. When I try to use the replace
function, it gives an error "Sub or function is not
defined"
Maurice