Page 1 URL is:
HTML:
http://espn.go.com/mlb/stats/batting/_/split/31/count/1/qualified/false
I guessed the "/count/1" part based on the other pages, to give a uniform URL.
Page 2 URL is:
HTML:
http://espn.go.com/mlb/stats/batting/_/split/31/count/41/qualified/false
Page 3 URL is:
HTML:
http://espn.go.com/mlb/stats/batting/_/split/31/count/81/qualified/false
With that, use a For n = 1 to 121 Step 40 loop (or whatever the last page is) with the BabyNames QueryTables code, updating the Connection string URL with the value of 'n' and the Destination cell argument, as needed.
This is what I came up with - it cycles through but no data actually appears:
Sub BatterVsLeftHand()
Dim nextRow As Integer, n As Integer
Application.ScreenUpdating = False
Application.DisplayStatusBar = True
For n = 1 To 441 Step 40
Application.StatusBar = "Processing Page " & n
nextRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row + 1
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;
2015 Regular Season MLB Baseball Batting Statistics and League Leaders - Major League Baseball - ESPN & n & /qualified/false", _
Destination:=Range("A" & nextRow))
.Name = "mlb/stats/batting/_/split/31/count/440/qualified/false"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "22"
.WebPreFormattedTextToColumns = False
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
ThisWorkbook.Save
Next n
Application.StatusBar = False
End Sub
I must still be missing something.