PC Review


Reply
Thread Tools Rate Thread

Replace in VBA Excel

 
 
Maurice
Guest
Posts: n/a
 
      15th Jul 2003
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 With Quote
 
 
 
 
Chip Pearson
Guest
Posts: n/a
 
      15th Jul 2003
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 (E-Mail Removed)




"Maurice" <(E-Mail Removed)> wrote in message
news:0ccb01c34adf$49ce86e0$(E-Mail Removed)...
> 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 With Quote
 
 
 
 
Maurice
Guest
Posts: n/a
 
      15th Jul 2003
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 (E-Mail Removed)
>
>
>
>
>"Maurice" <(E-Mail Removed)> wrote in message
>news:0ccb01c34adf$49ce86e0$(E-Mail Removed)...
>> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Macro to replace VBA module within outlook P13RR3 Microsoft Outlook VBA Programming 1 22nd Sep 2011 08:47 AM
VBA Macro to open excel file and replace VBA module with update Forgone Microsoft Excel Programming 3 8th Apr 2010 03:16 AM
Access VBA - declared an Excel VBA reserved word and VBA/Access won't give it back! ultar6@gmail.com Microsoft Access 1 16th Jun 2007 05:11 AM
Replace text with variable using VBA replace code? Mike Microsoft Excel Programming 2 9th Nov 2006 07:06 PM
Replace methode, Replace Function, Stringbuilder replace, Regex Replace, Split Cor Microsoft VB .NET 4 1st Mar 2004 03:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:19 AM.