Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Exclamation Large Excel Email list with Non printing character

Hello all!

I have a large email list in Excel and it comes with non printing characters leading and trailing. I have used both TRIM and CLEAN functions, neither work all the way. I am wondering if there is an add-in for this or a program that would clean these? At this point I am having to do this by hand... wasting LOTS of time!

Please help!!! :)
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,514
Default Large Excel Email list with Non printing character

Alhalford wrote :
Hello all!

I have a large email list in Excel and it comes with non printing
characters leading and trailing. I have used both TRIM and CLEAN
functions, neither work all the way. I am wondering if there is an
add-in for this or a program that would clean these? At this point I
am having to do this by hand... wasting LOTS of time!

Please help!!! :)


That's typical of imported lists that are delimited by carriage returns
and/or linefeeds. Here's a reusable function I use that will filter out
unwanted characters. It allows all alpha-numeric characters by default,
and you can specify other characters to be included. (In the case of
email addresses: " are the most common IncludeChars)

Function FilterString(ByVal TextIn As String, _
Optional IncludeChars As String, _
Optional IncludeLetters As Boolean = True, _
Optional IncludeNumbers As Boolean = True) As String
' Filters out all unwanted characters in a string.
' Args: TextIn The string being filtered.
' IncludeChars [Optional] Any characters to keep.
' IncludeLetters [Optional] Keeps any letters. Default=True
' IncludeNumbers [Optional] Keeps any numbers. Default=True
'
' Returns: String containing only the wanted characters.

Const sSource As String = "FilterString()"

'The basic characters to always keep
Const sLetters As String = "abcdefghijklmnopqrstuvwxyz"
Const sNumbers As String = "0123456789"

Dim i As Long, CharsToKeep As String

CharsToKeep = IncludeChars
If IncludeLetters Then _
CharsToKeep = CharsToKeep & sLetters & UCase(sLetters)
If IncludeNumbers Then _
CharsToKeep = CharsToKeep & sNumbers

For i = 1 To Len(TextIn)
If InStr(CharsToKeep, Mid$(TextIn, i, 1)) Then _
FilterString = FilterString & Mid$(TextIn, i, 1)
Next
End Function 'FilterString()

To use it in a cell formula:
(Assumes email addresses in col A, starting in A2)

In col B2, type ...

")

...and copy down.

If you store the function in PERSONAL.XLS then to use it in other
workbooks you need to prepend the workbook name like this...

")

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,514
Default Large Excel Email list with Non printing character

I see my reader has added link format to my IncludeChars string. To
clarify, it consists of the AT symbol (Shift+2), a hyphen, a period,
and an underscore.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,514
Default Large Excel Email list with Non printing character

Oops! Sorry about the typos...

In col B2, type ...

")

..and copy down.

If you store the function in PERSONAL.XLS then to use it in other
workbooks you need to prepend the workbook name like this...

")

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


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
Suppress Printing with Character in Excel File Shannoni Excel Discussion (Misc queries) 2 February 11th 10 11:30 PM
Problem printing a large excel cell Jenny Excel Discussion (Misc queries) 5 February 9th 09 12:43 PM
excel list of names, addresses and email to address book/contact list??? anna Excel Discussion (Misc queries) 0 October 24th 08 05:49 PM
Excel 2007 Large Format Printing Issue Capptyone Excel Discussion (Misc queries) 1 May 22nd 07 04:01 PM
Printing from email without Word/Excel mejsunflower Excel Worksheet Functions 1 May 6th 05 03:12 PM


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