Need Macro to pull data from list and create new worksheets for each result
I am trying to modify a macro I have that will help me use the macro below to help me go through a list of players to pull all the data tables mentioned below into one worksheet per player and then move on to the next player with their stats on the next worksheet. Right now I am going through each player one by one with the macro below and takes a lot of time and trying to see if there is a quicker solution.
I have attached the list of players in the Excel file and then attached a notepad file of the query file that I used in Excel. Below is the code that I am currently using.
[CODE]Sub H()
'
' H Macro
'
' Keyboard Shortcut: Ctrl+Shift+H
'
With ActiveSheet.QueryTables.Add(Connection:= _
"FINDER;C:\Users\mlaporte\Dropbox\NFL\Web Query\H.iqy", Destination:=Range( _
"$A$1"))
.Name = "H"
.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 = _
"""defense"",""games_played"",""kicking"",""returns"",""passing"",""receiving_and_rushing"",""rushing_and_receiving"",""scoring"""
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub [/CODE]
Any help on how to speed up this process would be greatly appreciated. Thank you in advance.
Attachment | Size |
---|---|
H List.xlsx | 28.54 KB |
H IQY File.txt | 367 bytes |
Recent comments
5 years 41 weeks ago
6 years 27 weeks ago
6 years 39 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 48 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago