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

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Replace in VBA Excel

Thanks,
That did it for me!!!!
Maurice

-----Original Message-----
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



.

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 value in excel? [email protected] Excel Worksheet Functions 3 January 7th 06 09:09 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 08:12 PM.

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"