![Old](images/statusicon/post_old.gif)
29th May 2009, 02:01 PM
|
Member
|
|
Join Date: Jan 1970
Location: Western Australia
Posts: 3,455
|
|
I have made some changes to the way i want to import webpages but need some help.
Below is the code i will use to import a web query but what i need to do is link it to a cell that will use a vlookup formula what i intend to do is in column A i will have a list of races in column B i will have a weblink to the races then in cell C1 i will have the vlookup formula i need the macro to run and return the contenst of the webpage in excel.
I have looked at a few examples but and still not getting the result i need
Code:
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https://www.betchoice.com/racing/betting.asp?eventid=275684", Destination _
:=Range("D1"))
.Name = "betting.asp?eventid=275684"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = """HorseTable"""
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
|