Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Formula to Remove Special Characters

I am trying to figure out a formula that I can use to remove special
characters from Excel 2007 cells. I've used a user function in the
past but can't this time. The Paste special; doesn't cut it either.

Does anyone know of a way to build a formula to remove special
characters?

Thank you,
Jeff


Here's what I've used ion the past that I can't use now in case it
might help some one.

Here's first the formula used to call the function followed by the
code.

=RegExpReplace(EndUsrPhon1,"^ +| +$|\\n|/n| |[^0-9 ]","",TRUE,FALSE)



Function RegExpReplace(LookIn As String, PatternStr As String,
Optional ReplaceWith As String = "", _
Optional ReplaceAll As Boolean = True, Optional MatchCase As
Boolean = True)
' This function uses Regular Expressions to parse a string, and
replace parts of the string
' matching the specified pattern with another string. The
optional argument ReplaceAll controls
' whether all instances of the matched string are replaced (True)
or just the first instance (False)

Static RegX As Object

If RegX Is Nothing Then Set RegX = CreateObject("VBScript.RegExp")
With RegX
.Pattern = PatternStr
.Global = ReplaceAll
.IgnoreCase = Not MatchCase
End With

RegExpReplace = RegX.Replace(LookIn, ReplaceWith)

End Function
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Formula to Remove Special Characters

TRIM will remove all char 32 spaces except for single spaces between words.

CLEAN will remove *some* nonprintable characters.

If you know what the character codes are you can use the SUBSTITUTE
function:

=SUBSTITUTE(A1,CHAR(255),"")

=SUBSTITUTE(SUBSTITUTE(A1,CHAR(255),""),CHAR(160), "")

--
Biff
Microsoft Excel MVP


"JP Jones" wrote in message
...
I am trying to figure out a formula that I can use to remove special
characters from Excel 2007 cells. I've used a user function in the
past but can't this time. The Paste special; doesn't cut it either.

Does anyone know of a way to build a formula to remove special
characters?

Thank you,
Jeff


Here's what I've used ion the past that I can't use now in case it
might help some one.

Here's first the formula used to call the function followed by the
code.

=RegExpReplace(EndUsrPhon1,"^ +| +$|\\n|/n| |[^0-9 ]","",TRUE,FALSE)



Function RegExpReplace(LookIn As String, PatternStr As String,
Optional ReplaceWith As String = "", _
Optional ReplaceAll As Boolean = True, Optional MatchCase As
Boolean = True)
' This function uses Regular Expressions to parse a string, and
replace parts of the string
' matching the specified pattern with another string. The
optional argument ReplaceAll controls
' whether all instances of the matched string are replaced (True)
or just the first instance (False)

Static RegX As Object

If RegX Is Nothing Then Set RegX = CreateObject("VBScript.RegExp")
With RegX
.Pattern = PatternStr
.Global = ReplaceAll
.IgnoreCase = Not MatchCase
End With

RegExpReplace = RegX.Replace(LookIn, ReplaceWith)

End Function



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Formula to Remove Special Characters

On Tuesday, December 8, 2009 at 7:56:06 AM UTC+5:30, JP Jones wrote:
I am trying to figure out a formula that I can use to remove special
characters from Excel 2007 cells. I've used a user function in the
past but can't this time. The Paste special; doesn't cut it either.

Does anyone know of a way to build a formula to remove special
characters?

Thank you,
Jeff


Here's what I've used ion the past that I can't use now in case it
might help some one.

Here's first the formula used to call the function followed by the
code.

=RegExpReplace(EndUsrPhon1,"^ +| +$|\\n|/n| |[^0-9 ]","",TRUE,FALSE)



Function RegExpReplace(LookIn As String, PatternStr As String,
Optional ReplaceWith As String = "", _
Optional ReplaceAll As Boolean = True, Optional MatchCase As
Boolean = True)
' This function uses Regular Expressions to parse a string, and
replace parts of the string
' matching the specified pattern with another string. The
optional argument ReplaceAll controls
' whether all instances of the matched string are replaced (True)
or just the first instance (False)

Static RegX As Object

If RegX Is Nothing Then Set RegX = CreateObject("VBScript.RegExp")
With RegX
.Pattern = PatternStr
.Global = ReplaceAll
.IgnoreCase = Not MatchCase
End With

RegExpReplace = RegX.Replace(LookIn, ReplaceWith)

End Function


Hi Team,

please help me with the formula to remove the special characters from the strings like below

Vim Drop DwÃÆÀ*€„¢ÃƒÆ’€šÃ€šÃ‚¢ÃƒÆ €šÃ€šÃ€šÃ‚ Gel-Lmon, 115ml Pack
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
Special Characters sandyboy Excel Worksheet Functions 2 September 19th 07 04:02 PM
How do I remove "special characters" from cell data? Cal Excel Discussion (Misc queries) 3 July 17th 06 07:13 PM
Special characters Matthew S Excel Discussion (Misc queries) 10 September 24th 05 12:36 AM
Remove characters from a text string using a formula duncrbrt Excel Discussion (Misc queries) 1 June 4th 05 02:19 AM
REMOVE SPECIAL CHARACTERS FROM TEXT CELLS javila255 Excel Worksheet Functions 1 April 2nd 05 06:24 PM


All times are GMT +1. The time now is 05:26 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"