I am trying to see if anyone can help me in making this Excel VBA code a little faster in rendering the data from the weather site I am using. Maybe instead of getting all 14 days it includes in the site, could I get help in getting just 10 days? Any help is much appreciated. Thanks!
Sub MiamiWeather()
Dim HTTP As Object, HTML As Object, i As Integer, j As Integer
Set HTML = CreateObject("HTMLFILE")
Set HTTP = CreateObject("MSXML2.XMLHTTP")
myURL = "https://weather.com/weather/tenday/l/3881cd527264bc7c99b6b541473c0085e75aa026b6bd99658c56ad9bb55bd96e"
HTTP.Open "GET", myURL, False
HTTP.send
HTML.body.innerHTML = HTTP.responseText
Set objCollection = HTML.getElementsByTagName("p")
i = 0
Do While i < objCollection.Length And j < 20
If objCollection(i).getAttribute("data-testid") = "wxPhrase" Then
j = j + 1
Range("A" & j) = objCollection(i).PreviousSibling.PreviousSibling.FirstChild.innerText
Range("B" & j) = objCollection(i).PreviousSibling.FirstChild.innerText
End If
i = i + 1
Loop
Set HTML = Nothing
Set HTTP = Nothing
End Sub

Debug.Print "Section:"; (Timer - stTime)*1000;"ms") I ran and profiled your code. About 50% of the running time is spent in that While loop, 30% is spent loading the HTML document from the HTTP response, the other 20% spent in the Get request. Consequently I'd say the best optimisations come from the while loop, and you may want to profile that in more detail. It's true, stopping after j = 10 rather than 14 saves ~ 25% of the loop time, however looping over all<p>elements is wasteful and you may want to trygetElementsByClassNameto narrow the search \$\endgroup\$