Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Extract email from excel worksheets

Hi all,

I have a question.
Because of my job... I always receiving worksheets ....
I need to extract the email address in these worksheets into a new
worksheet...
(i.e.: a new worksheet contains ALL emails address from other
worksheets... probably over 100+)

Can anyone teach me how to do this? I heard VBA can do this... but
how?

Thanks in advance.
Chan

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Extract email from excel worksheets

Maybe this ??

The example below will copy all cells with a E-Mail Address in
Sheets("Sheet1").Range("A1:E100") to the A column of "Sheet2"
Note : I use xlPart in the code instead of xlWhole to find each cell with a @ character.

You can loop through all sheets if you want or do you mean workbooks ?

Sub Copy_To_Another_Sheet_1()
Dim FirstAddress As String
Dim MyArr As Variant
Dim Rng As Range
Dim Rcount As Long
Dim I As Long

Application.ScreenUpdating = False
'You can also use more values in the Array
'myArr = Array("@", "www")
MyArr = Array("@")

Rcount = 0
With Sheets("Sheet1").Range("A1:E100")

For I = LBound(MyArr) To UBound(MyArr)
'If you use LookIn:=xlValues it will also work with a
'formula cell that evaluates to "@"
'Note : I use xlPart in this example and not xlWhole

Set Rng = .Find(What:=MyArr(I), _
After:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
FirstAddress = Rng.Address
Do
Rcount = Rcount + 1
' This example will only copy the value
Sheets("Sheet2").Range("A" & Rcount).Value = Rng.Value
Set Rng = .FindNext(Rng)
Loop While Not Rng Is Nothing And Rng.Address < FirstAddress
End If
Next I
End With
Application.ScreenUpdating = True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



wrote in message ups.com...
Hi all,

I have a question.
Because of my job... I always receiving worksheets ....
I need to extract the email address in these worksheets into a new
worksheet...
(i.e.: a new worksheet contains ALL emails address from other
worksheets... probably over 100+)

Can anyone teach me how to do this? I heard VBA can do this... but
how?

Thanks in advance.
Chan



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
Extract email(s) from address field Eli[_4_] Excel Discussion (Misc queries) 3 November 7th 14 10:42 AM
I would like to extract email addresses from an Excel document ladyblue214 Excel Discussion (Misc queries) 1 May 8th 10 10:40 AM
How to extract email address in hyperlink Brossyg Excel Worksheet Functions 6 January 27th 07 03:32 PM
Extract email addresses Excel Worksheet Functions 9 December 15th 06 09:05 PM
Extract Email from a Picture [email protected] Excel Programming 1 April 9th 06 07:48 AM


All times are GMT +1. The time now is 06:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"