Here is a starting point for a macro that you could assign to a button. Check for the worksheet name, columns I am using in the code as well as rows, so you can adjust those if needed:
Sub CheckURLs()
Dim request As Object
Dim ws As Worksheet
Dim lr As Long, i As Long
Dim url As String
Set request = CreateObject("winhttp.winhttprequest.5.1")
Set ws = ThisWorkbook.Worksheets("Sheet1")
'last row with data in column A:
lr = ws.Range("A" & Rows.Count).End(xlUp).Row
On Error GoTo haveError
For i = 2 To lr 'starts on row 2 assuming there are headers, if not then adjust
next_row:
With request
url = ws.Range("A" & i).Value
'if the url in the cell doesn't start with http:// then we add it, hoping that resolves any issues.
If Not url Like "http*" Then url = "http://" & url
.Open "head", url
.send
.WaitForResponse
ws.Range("B" & i).Value = .Status
End With
Next i
Exit Sub
haveError:
ws.Range("B" & i).Value = Err.Description
'if there are still rows to process then go back up:
If i < lr Then GoTo next_row
End Sub
Bookmarks