Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a list of a large number of addresses from a UK news website in a Excel sheet. e.g. http://......./england/kent/485276.stm http://......./england/kent/485277.stm http://......./england/kent/485278.stm etc. etc. These are down in a column (A1....A800+). As I'm trying to pick out particular news items, I need a function to return just the content of the hypertext element "<TITLE". Is there an already defined Excel function that could do this, or do I need to explore the delights of VBA, which I'm new to? Any ideas or help? Many thanks, Steve |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Steve,
I don't know of a built-in function to do this. You can do this by automating IE in a user-defined function (open the VBE with Alt+F11, insert a new standard module, and paste in this code): Public Function GETURLPAGETITLE(sURL As String) As String Dim ie As Object Set ie = CreateObject("InternetExplorer.Application") ie.Navigate sURL Do Until ie.ReadyState = 4 DoEvents Loop GETURLPAGETITLE = ie.Document.Title ie.Quit Set ie = Nothing End Function Then, in your cell, you could use a formula like this: =geturlpagetitle(A1) Since you have tons of URLs to get the titles for, you may want to keep IE open the whole time instead of opening it, navigating to the URL, and closing it like I'm doing in this function. So a script to run through your list, navigating to each page, and writing out the titles as you go would be more efficient. -- Regards, Jake Marx www.longhead.com [please keep replies in the newsgroup - email address unmonitored] uP..AND..DOWn wrote: Hi, I have a list of a large number of addresses from a UK news website in a Excel sheet. e.g. http://......./england/kent/485276.stm http://......./england/kent/485277.stm http://......./england/kent/485278.stm etc. etc. These are down in a column (A1....A800+). As I'm trying to pick out particular news items, I need a function to return just the content of the hypertext element "<TITLE". Is there an already defined Excel function that could do this, or do I need to explore the delights of VBA, which I'm new to? Any ideas or help? Many thanks, Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I change an Excel report title that shows in top left corn. | Excel Discussion (Misc queries) | |||
Excel on Webpage | Excel Discussion (Misc queries) | |||
Automate Excel report to place certain data into existing report? | Excel Worksheet Functions | |||
Named range=Column title,comumn title in cellB6 use B6in equation | Excel Discussion (Misc queries) | |||
Webpage/excel? | Excel Programming |