Need code to search email id from website links through excel

Copper Contributor

Hi Experts,

 

Can someone pls  help me and provide me Macro VBA code excel template wherein i have list of website addresses and need to search e-mail id from the entire website by running Macro VBA code and paste it in excel.

 

Regards

 

NKD

7 Replies

@nkd8477 

To create a VBA code, you should have more information on how to add internet addresses and lines / columns where it should be added. A lot of work, this is close to commissioned work, as it would have to be specially tailored so that it should work properly.
Try it in advance with this information, maybe you can solve your problem faster and better.

Import data from external data sources (Power Query)

https://support.microsoft.com/en-gb/office/import-data-from-external-data-sources-power-query-be4330...

 

I would be happy to know if I could help.

 

Nikolino

I know I don't know anything (Socrates)

 

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.

@nkd8477 

Please check this post https://stackoverflow.com/questions/19976326/getting-links-url-from-a-webpage-excel-vba if helps, that's to get all links from the web page. 

@Sergei Baklan @NikolinoDE  Hi, thanks for the info. i do not have any hands on and idea in programming. i want to extract e-mail id's in excel from the multiple websites on click of button through macro code..

 

i appreciate if you can help me in providing working excel with above requirements

 

The whole thing is not so easy to deal with. You would have to know the internet address, where it should be saved, in which columns / lines, etc., this is commissioned work in my opinion and I don't have the time for that. However I'm out of the number, I can't help. Wish you success in your project with a lot of health, joy and love. Nikolino I know I don't know anything (Socrates)

@NikolinoDE In excel sheet 1 column A will be website addresses and in column B will fetch e-mail id's of website addresses given A.

 

 

@nkd8477 

 

Maybe this will help you to create your own VBA code or everything as you wish.

 

Hyperlinks via VBA

With this macro all hyperlinks of a defined cell range can be read out. In this example, the macro scans column A and lists the results, i.e. all hyperlinks read in column B.

 

Public Sub Hyperlink_niko ()
'Read out the hyperlink address
Dim hlink As Hyperlink
i = 1
For Each hlink In Sheets (1) .Hyperlinks
Sheets (1) .Cells (i, 2) .Value = hlink.Address
i = i + 1
Next hlink
End Sub

 


If the hyperlinks are mail addresses, the word mailto: is also automatically output. As a result, you will receive, for example, the email address of the hyperlink as follows: mailto: nikolino@excelsius.com
The following macro removes this addition and only outputs nikolino@excelsius.com as a hyperlink. The addition mailto: is removed.

 

Public Sub Hyperlink_lino_mail address ()
Dim hlink As Hyperlink
i = 1
'Read out the hyperlink address
For Each hlink In Sheets (1) .Hyperlinks
mail = hlink.Address
mailneu = Right (mail, Len (mail) - 7)
Sheets (1) .Cells (i, 2) .Value = mail new
i = i + 1
Next hlink
End Sub

 


With the help of the Right () function, this macro removes the addition "mailto:" from the read mail address.

 

 

I would be happy to know if I could help.

 

Nikolino

I know I don't know anything (Socrates)

 

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.

@NikolinoDE thanks but this is not i am looking for.

 

Example - i have site www.cnbc.com in Colum A in Sheet1.

 

i want that on click on button the macro code should run and should scan this above website and should search for e-mail id's in the page and when found it should paste it in column B in excel.