Thread: more excel help
View Single Post
  #5  
Old 15th October 2005, 09:19 PM
Chrome Prince Chrome Prince is offline
Member
 
Join Date: Jan 1970
Posts: 4,415
Default

Dr RON on sheet1 copy a list of the urls as such in cellA1,A2,A3 etc. under eachother......
http://www.tabonline.com.au/2002/10/12/MR01.html
http://www.tabonline.com.au/2002/10/13/MR02.html
http://www.tabonline.com.au/2002/10/13/MR03.html
http://www.tabonline.com.au/2002/10/13/MR04.html

etc.

You'll need to do this part manually unfortunately.

Now record a macro, any dummy macro and save it.

Open up and step into the newly created macro, clear all entries until you have a blank macro page and copy and paste the code below....

Sub ImportData()

Sheets(2).Activate
A = 1
Do Until Sheets(1).Cells(A, 1) = ""
myquery = Sheets(1).Cells(A, 1)
Sheets(2).Cells(1, 1) = myquery
myrow = Sheets(2).UsedRange.Rows.Count + 1
Do
myrow = myrow - 1
Loop Until Sheets(2).Cells(myrow, 1) <> ""
myrow = myrow + 1
With Sheets(2).QueryTables.Add(Connection:= _
"URL;" & myquery, Destination:=Sheets(2).Cells(myrow, 1))
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
A = A + 1
Loop

End Sub

Save it as ImportData

Run the macro, it should paste the webpages one under the other on sheet2 of your workbook.

As long as you use it for yourself only, I don't see the problem. Unitab are hardly going to break into your house with a torch at 4am and go "Gotcha!".

They keep this information on their website for 2 years, so they keep it there for people to use.
__________________
RaceCensus - powerful system testing software.
Now with over 413,000 Metropolitan, Provincial and Country races!
http://www.propun.com.au/horse_raci...ng_systems.html
*RaceCensus now updated to 31/01/2025
Video overview of RaceCensus here:
http://www.youtube.com/watch?v=W821YP_b0Pg
Reply With Quote