ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Listing html Title tag in a spreadsheet. (https://www.excelbanter.com/excel-programming/282640-listing-html-title-tag-spreadsheet.html)

Gustavus Vasa

Listing html Title tag in a spreadsheet.
 
I have reached the end of my limited knowledge.

I am dealing with a large number of html files where the file name bares no
resemblance to the contents.

I can put a list of all the files in the column B of my spreadsheet.

What I need to do is put the text between the <title and </title tags in
the next column.

I am running excel 2002, but if this could work for 2000 so I could use it
at work it would be cool.

Regards
Steve the dropbear



keepITcool

Listing html Title tag in a spreadsheet.
 
Following should do it..
...change directory before running it

Sub ReadTitles()
Dim wb As Workbook, rng As Range, r&, sFile$
Set rng = ActiveCell
sFile = Dir("*.htm*")
Application.ScreenUpdating = False
While sFile < ""
Set wb = Workbooks.Open(sFile)
r = r + 1
rng(r, 1) = wb.Name
rng(r, 2) = wb.BuiltinDocumentProperties("Title")
wb.Close
sFile = Dir
Wend
Application.ScreenUpdating = True
End Sub


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Gustavus Vasa" wrote:

I have reached the end of my limited knowledge.

I am dealing with a large number of html files where the file name
bares no resemblance to the contents.

I can put a list of all the files in the column B of my spreadsheet.

What I need to do is put the text between the <title and </title
tags in the next column.

I am running excel 2002, but if this could work for 2000 so I could
use it at work it would be cool.

Regards
Steve the dropbear






All times are GMT +1. The time now is 06:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com