View Single Post
 
Old 02-18-2016, 05:58 PM
NoSparks NoSparks is offline Windows 7 64bit Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

I believe the .Pattern thing works opposite to your line of thought.

.Pattern = "[^characters you want to keep]"

.Pattern = "[^A-Za-z0-9\ ]"
keeps upper case A thru Z
keeps lower case a thru z
keeps numerals 0 thru 9
don't know what the back slash does as back slashes are removed
keeps spaces

I add a row to the top of your data and put in this

.Pattern = "[A-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!" & "#$%&'*+/=\?^_`{|}~-]+)*@(?:[a-z0-9](?:" & _"[a-z0-9-]*[a-\z0-9])?\.)+[a-z0-9](?:" & _"[a-z0-9-]*[a-z0-9])?"

use debug.print and this is what it gets reduced to using .Pattern = "[^A-Za-z0-9\ ]"

Pattern AZ09az09 az09 az09az09az09 az09az09
Reply With Quote