Link to home
Start Free TrialLog in
Avatar of rutgermons
rutgermons

asked on

Excel macro, loop thru entire column/all rows

folks the below looks at column/row a1 and in colum b1 gives and output

how do i get it to do the same for the entire colum a's values and display for column b?

all help will do

Private Sub TestGetStatus()
    GetStatus "A1"
End Sub

Sub GetStatus(ByVal Ref As String)

    Dim HttpReq As Object
    Dim Rslt As Variant
   
    Set HttpReq = CreateObject("MSXML2.XMLHTTP")
   
    On Error Resume Next
    With HttpReq
        .Open "GET", ActiveSheet.Range(Ref).Value, False
        .Send
        If Err Then
            Rslt = "No connection"
        Else
            Rslt = Val(.Status)
            If Err Then
                Rslt = "No Response"
            Else
                Rslt = "Status: " & Rslt
            End If
        End If
    End With
    ActiveSheet.Range(Ref).Offset(0, 1).Value = Rslt
End Sub
ASKER CERTIFIED SOLUTION
Avatar of drfrank319
drfrank319

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial