Get HTML table from a website based on a hyperlink in a cell

0

The following code gets me my HTML table just fine. However I need to use a dynamic URL based on a Cell reference in the active sheet - Cell("A27").

Below is the code I have been using:

Sub GetWebTable()

With ActiveSheet.QueryTables.Add(Connection:="URL;https://dq.cde.ca.gov/dataquest/dqcensus/EnrCharterLevels.aspx?cds=1975309&agglevel=district&year=2018-19", Destination:=Range("A30"))
.Refresh BackgroundQuery:=False
.SaveData = True
End With

End Sub

Thank you very much in advance

mm_vtd

Posted 2019-05-01T23:01:24.107

Reputation: 1

1How about save the string value from the cell into a variable.. then put Connection:= <that_variable> ? (just a suggestion..) – p._phidot_ – 2019-05-02T00:32:07.560

No answers