dawn Master Poster
Joined: 26 Jun 2004 Posts: 311 Location: Mishawaka, IN
|
Posted: Mon May 19, 2008 11:10 am Post subject: Just Letters and Numbers |
|
|
This will strip out all characters that are not alpha-numeric, that is numbers and letters.
Code: |
Option Explicit
dim objRegEx
dim strSearchString
Set objRegEx = CreateObject("VBScript.RegExp")
objRegEx.Global = True
objRegEx.Pattern = "[^A-Za-z0-9]"
'**If you don't want numbers either then use: "[^A-Za-z]"
strSearchString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz!@#$%&*(_+"
strSearchString = objRegEx.Replace(strSearchString, "")
msgbox strSearchString
|
_________________ Dawn Mitchell
Manufacturing Information Solutions
www.mis-group.com |
|