Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA: Replace$: Sub or Function not defined

Status
Not open for further replies.

SteveJL

Computer
Joined
Jun 9, 2004
Messages
2
Location
US
I am using Replace$ in some VBA code in Excel without any problem. I have distributed the file to several testers and for the most part it's ok.

However, one user is getting "Sub or Function not defined" and the Replace$ function is highlighted.

Does anyone know why this is happening?
 
What version of Excel (and SP level) is the failing machine running, and how does that compare to all the machines that are running?

I would also check and compare the References between the failing machine and a running machine.
 
Thanks CC. You are correct. The failing workstations (turns out there are more than one) are running with Excel 97. Replace$ is not supported under this version.

The .xls was created with Excel 2002.
 
Makes sense. As I see it, you have two options. 1) Update everyone to at least 2000, or 2) write you own Replace function inside the workbook.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top