Q:

Cycling Through List of URLs Using Excel VBA

I am much more familiar with Excel now, but one thing is still baffling me - how to cycle through URLs in a loop. My current conundrum is that I have this list of URLs of packages, and need to obtain the status of each package on each page using its HTML. What I currently have to cycle through the list is:
Sub TrackingDeliveryStatusResults()

Dim IE As Object
Dim URL As Range
Dim wb1 As Workbook, ws1 As Worksheet

Dim filterRange As Range
Dim copyRange As Range
Dim lastRow As Long

Set wb1 = Application.Workbooks.Open("\\S51\******\Folders\******\TrackingDeliveryStatus.xls")
Set ws1 = wb1.Worksheets("TrackingDeliveryStatusResults")

Set IE = New InternetExplorer

With IE
    .Visible = True
    For Each URL In Range("C2:C & lastRow")
        .Navigate URL.Value
        While .Busy Or .ReadyState <> 4: DoEvents: Wend
        MsgBox .Document.body.innerText
    Next
End With

End Sub

And the list of URLs 
My goal here is:

Cycle through each URL (inserts URL in IE and keeps going without opening new tabs)
Obtain the status of the item for each URL from the HTML element
FedEx: Delivered (td class="status")
UPS:  Delivered (id="tt_spStatus")
USPS: Arrived at USPS Facility (class= "info-text first)
Finish the loop and save as a csv if at all possible (I've already done that, so I'm just posting the code portion I'm having a problem with).

My understanding is that I have to code a different if statement for each different url, since all of them have different HTML tags for their delivery status. Loops are simple, but to loop through webpages is new to me. The code has been throwing me errors no matter what changes I make. 
The IE object opens up but then Excel hits an error and the code stops running.

A:

OK Ill start with the proper syntax for you to get your code going and I will edit this answer for further code
Sub Sample()

Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.EnableEvents = True

Dim wsSheet As Worksheet, Rows As Long, links As Variant, IE As Object, link As Variant
Set wb = ThisWorkbook
Set wsSheet = wb.Sheets("Sheet1")

Set IE = New InternetExplorer

Rows = wsSheet.Cells(wsSheet.Rows.Count, "A").End(xlUp).Row
links = wsSheet.Range("A1:A" & Rows)

With IE
    .Visible = True
    For Each link In links
        .navigate (link)
        While .Busy Or .ReadyState <> 4: DoEvents: Wend
        MsgBox .Document.body.innerText
    Next link
End With

Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Application.EnableEvents = True

End Sub

This will get you looping I think you had some general syntax issues which you can see the difference in my code in order to loop through in the for each the link has to be of type object or variant and links I set to variant assuming it will default to a string

