Built-in string functions not availble

  • Thread starter Thread starter Mark R. Rutter
  • Start date Start date
M

Mark R. Rutter

Function SUBSTITUTE not available. When I run
Zip = Substitute("2003 Budget", "2003", "2004"), I get error message saying
that Function not defined. Why?
 
There's no function by that name built into any version of Access with which
I'm familiar.

Perhaps you mean the Replace function?
 
I found the answer.
SUBSTITUTE is a worksheet function with no equivalent VBA function. To use
the worksheet function in VBA, the code looks like,
Zip = WorksheetFunction.Substitute("2003 Budget", "2003", "2004").

The same applies to worksheet functions FIND and SEARCH
 
Back
Top