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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top