From: Gordon on 21 Apr 2010 09:29 Hi I have 1900 lines of information. Each one begins with a persons name, followed by a random gap then followed by an email address. What I need is just the email addresses. SO the macro needs to look at each line. Identify where the persons name ends, delete, delete the space afterwards, and leave the email address intact. Any help appreciated. I know excel VB, not Word! Thanks Gordon
From: DaveLett on 21 Apr 2010 09:36 Hi Gordon, You don't NEED a macro to get this done; instead, you can use a wildcard search and replace. Open the Find and Replace dialog box, select the Use Wildcards check box, and place the following in the Find what box: [A-z]{1,} Leave the Replace with box empty. Do a Replace All. HTH, Dave P.S. If this must be a macro, just let me know. "Gordon" wrote: > Hi > > I have 1900 lines of information. Each one begins with a persons name, > followed by a random gap then followed by an email address. What I need is > just the email addresses. SO the macro needs to look at each line. Identify > where the persons name ends, delete, delete the space afterwards, and leave > the email address intact. > > Any help appreciated. I know excel VB, not Word! > > Thanks Gordon
From: Gordon on 21 Apr 2010 09:46 Hi Dave Is there a Macro too...? (please?) G "DaveLett" wrote: > Hi Gordon, > You don't NEED a macro to get this done; instead, you can use a wildcard > search and replace. Open the Find and Replace dialog box, select the Use > Wildcards check box, and place the following in the Find what box: > > [A-z]{1,} > > Leave the Replace with box empty. Do a Replace All. > > HTH, > Dave > > P.S. If this must be a macro, just let me know. > > "Gordon" wrote: > > > Hi > > > > I have 1900 lines of information. Each one begins with a persons name, > > followed by a random gap then followed by an email address. What I need is > > just the email addresses. SO the macro needs to look at each line. Identify > > where the persons name ends, delete, delete the space afterwards, and leave > > the email address intact. > > > > Any help appreciated. I know excel VB, not Word! > > > > Thanks Gordon
From: DaveLett on 21 Apr 2010 10:48 Hi Gordon, I think this is what you're looking for: With Selection .HomeKey Unit:=wdStory With .Find .ClearFormatting .text = "[A-z]{1,} {1,}" .MatchWildcards = True With .Replacement .ClearFormatting .text = "" End With .Execute Replace:=wdReplaceAll End With End With Dave
|
Pages: 1 Prev: Duplication Macro & Macro crashing Word Next: link and populate multiple document |