# Need Excel Macro VBScript Help



## dmoase (Mar 18, 2009)

Hello there,

I have a Macro in excel to pull information from a table on a webpage that used to work fine until the website changed the table so now it's not pulling the correct information. It's supposed to pull from a Box Score on a Yahoo Sports page. 

For example: http://sports.yahoo.com/nba/boxscore?gid=2009031701

From this page it should grab the total number of FG as well as FT, OFF and TO for each team.

This is the code that I have for that part:

Dim i, j, k As Integer
Dim URLStr As String
Dim FirstPoints As Boolean
i = 1
k = 1
Sheets("Sheet4").Range("A1:F500").ClearContents
Do While Sheets("Sheet1").Range("A" & i).Value <> ""
FirstPoints = False

k = k + 3

URLStr = Sheets("Sheet1").Range("A" & i).Value
On Error Resume Next
With Sheets("Sheet2").QueryTables.Add(Connection:= _
"URL;" & URLStr & "", Destination:=Sheets("Sheet2").Range _
("A1"))
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = False
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "9,13,15"
.WebPreFormattedTextToColumns = False
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = True
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
On Error GoTo 0

Could anyone give me a hand with this please? If you need to see more of the code just let me know.


----------



## dmoase (Mar 18, 2009)

Never min I figured it out


----------

