LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Replace more characters using replace

Hi

I have number of characters in a string, that I like to replace with
"nothing". I use a code like this:

Sub test()
Dim a As String
a = "Jan+& Per"
a = Replace(a, " ", "")
a = Replace(a, "&", "")
a = Replace(a, "+", "")
MsgBox a
End Sub


As I have about 15 characters, that all should be replaced with
nothing, I am looking ofr another way to it. Something like

Sub test()
Dim a As String
a = "Jan+& Per"
a = Replace(a, {" ", "&", "+"}, "")
MsgBox a
End Sub

Is this possible at all?

Jan
 
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
Use of Wildcard characters with replace tonuab Excel Discussion (Misc queries) 2 November 6th 09 09:39 PM
Replace last three characters Phillips via OfficeKB.com Excel Programming 3 February 12th 08 04:54 PM
Replace non printable characters TonyL Excel Worksheet Functions 4 August 25th 07 01:03 PM
Replace pattern of characters Fernando Excel Discussion (Misc queries) 5 March 21st 07 09:33 PM
Replace characters with symbols Michael Excel Programming 2 October 27th 06 02:37 PM


All times are GMT +1. The time now is 04:20 PM.

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

About Us

"It's about Microsoft Excel"