Object: to connect to the below URL, loop through number 1 - 4301, and copy the important elements to an active worksheet in Excel.
Below is the recorded macro for #4301. I need help with figuring out to automate the numbering of ".name=" and modify the ending of the "URL". The other item I need help with is bringing down the data where it doesn't overwrite each other...some how change the "Destination:=Range".
Your help is appreciated.
Below is the recorded macro for #4301. I need help with figuring out to automate the numbering of ".name=" and modify the ending of the "URL". The other item I need help with is bringing down the data where it doesn't overwrite each other...some how change the "Destination:=Range".
Your help is appreciated.
Code:
Sub Macro2()
'
' Macro2 Macro
'
'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;[URL unfurl="true"]http://www.okmedicalboard.org/physical_therapists/licensee/PT/4301",[/URL] _
Destination:=Range("$A$1"))
.Name = "4301_1"
.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
End Sub