Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Replace in Excel 97


I used the Replace function in my code while developing in
Excel XP. However, it comes back with an error when I try
to run it in Excel 97.

Is there an equivalent to the Replace function in Excel 97?
Note: this is not being used in the formula bar.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Replace in Excel 97

HOWTO: Simulate Visual Basic 6.0 String Functions in VB5
http://support.microsoft.com/default...b;EN-US;188007

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------


I used the Replace function in my code while developing in
Excel XP. However, it comes back with an error when I try
to run it in Excel 97.

Is there an equivalent to the Replace function in Excel 97?
Note: this is not being used in the formula bar.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Replace in Excel 97

No, Replace came in in XL2000.

You can write your own though

Function Replace97(Source As String, Find As String, Replace As String)
Dim iPos As Long
Dim sTemp As String

sTemp = Source
Do
iPos = InStr(sTemp, Find)
sTemp = Left(sTemp, iPos - 1) & Replace & Right(sTemp, Len(sTemp) -
Len(Find) - iPos + 1)
Loop Until InStr(sTemp, Find) = 0
Replace97 = sTemp
End Function


or you could use the worksheet substitute function

Debug.Print Application.Substitute("Bob", "o", "a")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"pcw" wrote in message
...

I used the Replace function in my code while developing in
Excel XP. However, it comes back with an error when I try
to run it in Excel 97.

Is there an equivalent to the Replace function in Excel 97?
Note: this is not being used in the formula bar.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace - Replace with Blank Space Studebaker Excel Discussion (Misc queries) 4 April 3rd 23 10:55 AM
Can I replace a ' at the beginning of a text cell using Replace Hilde Excel Discussion (Misc queries) 4 September 10th 07 06:22 PM
find and replace - replace data in rows to separated by commas msdker Excel Worksheet Functions 1 April 15th 06 01:00 AM
replace axis text with graphics on excel chart (excel 2003) Mad_Hatter_29 Charts and Charting in Excel 3 December 6th 05 01:42 PM
How can I use replace(alt+H) for mutiple items needing replace Gery Excel Worksheet Functions 1 June 15th 05 05:51 PM


All times are GMT +1. The time now is 05:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"