Joshua0317
New Member
- Joined
- Feb 23, 2011
- Messages
- 4
Hello,
I found a nice Statistics site I would like to use for my Fantasy Football league. It has all the stats for each week and position selectable from a drop down menu on the webpage. I recorded and altered a macro that will run through the numbers 1-16 for the weeks of play. I then changed it for each positions (QB, RB, WR, TE). The macro pulls each week without an issue. That gave me some hope. But when I switched the position for the next worksheet, it gave me a repeat of the QB data. Below is my code with the the portions I change highlighted.
Sub QBDATA()
'
' Macro2 Macro
'
Dim Part1, Part2, Part3, URL, TEMPNAME As String
Part1 = "URL;http://wp.advancednflstats.com/playerstatsWeek.php?week="
Part2 = "&posQB"
Part3 = "playerstatsWeek.php?week="
Dim i As Integer
i = 1
Do Until i = 17
URL = Part1 & i & Part2
TEMPNAME = Part3 & i & Part2
With ActiveSheet.QueryTables.Add(Connection:= _
URL, _
Destination:=Cells(i * 40 - 39, 2))
.Name = TEMPNAME
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
i = i + 1
Loop
End Sub
The original site I am getting the information from is:
http://wp.advancednflstats.com/playerstatsWeek.php?week=1&pos=RB
(Running Back week 1)
My Draft is on Thursday and I have been working on this for a week now. Any help would be a miracle.
Thanks all.
I found a nice Statistics site I would like to use for my Fantasy Football league. It has all the stats for each week and position selectable from a drop down menu on the webpage. I recorded and altered a macro that will run through the numbers 1-16 for the weeks of play. I then changed it for each positions (QB, RB, WR, TE). The macro pulls each week without an issue. That gave me some hope. But when I switched the position for the next worksheet, it gave me a repeat of the QB data. Below is my code with the the portions I change highlighted.
Sub QBDATA()
'
' Macro2 Macro
'
Dim Part1, Part2, Part3, URL, TEMPNAME As String
Part1 = "URL;http://wp.advancednflstats.com/playerstatsWeek.php?week="
Part2 = "&posQB"
Part3 = "playerstatsWeek.php?week="
Dim i As Integer
i = 1
Do Until i = 17
URL = Part1 & i & Part2
TEMPNAME = Part3 & i & Part2
With ActiveSheet.QueryTables.Add(Connection:= _
URL, _
Destination:=Cells(i * 40 - 39, 2))
.Name = TEMPNAME
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
i = i + 1
Loop
End Sub
The original site I am getting the information from is:
http://wp.advancednflstats.com/playerstatsWeek.php?week=1&pos=RB
(Running Back week 1)
My Draft is on Thursday and I have been working on this for a week now. Any help would be a miracle.
Thanks all.