Closed Thread
Results 1 to 6 of 6

Ping Host Name Column A IP address Result column B Response time Column c

  1. #1
    Registered User
    Join Date
    04-07-2011
    Location
    Philadelphia Pa
    MS-Off Ver
    Excel 2007
    Posts
    3

    Lightbulb Ping Host Name Column A IP address Result column B Response time Column c

    I am trying to create a spread sheet that is able to take the Host Name in the first column and ping it. Result being the IP address in the second column and response time in the third. Which in turn tells me the health of the network connection. I have applications that do this, but i would like this excel based. Dont know too much about vbs code.

    Thanks in advance!
    -Nick

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Ping Host Name Column A IP address Result column B Response time Column c

    Hello NickMac,

    Here is a macro that will read the URLs in column "A" of the active sheet. The IP address, the response time in milliseconds, and the status are returned in columns "B:D". The URLs are assumed to start in "A2" with headers in row 1. The URL should just be "www.server.com" and not include the protocol.

    Ping Macro
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    04-07-2011
    Location
    Philadelphia Pa
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Ping Host Name Column A IP address Result column B Response time Column c

    [SOLVED]

    This is great! Thanks for the quick response Leith!

  4. #4
    Registered User
    Join Date
    05-19-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Ping Host Name Column A IP address Result column B Response time Column c

    Hi,

    I'm unsure if I've done something wrong - however - I've created a new module, copied - pasted word for word the block of code above - my url list is in the required www.server.com format - however when i click run the ms appears in cell C2 but there is a Run-time error '94': Invalid use of null and when i select debug the below line is highlighted..

    Cell.Offset(0, 3) = GetPingStatus(objPing.StatusCode)

    in the block

    'Translate the query results to either True or False
    For Each objPing In colPings
    If Not objPing Is Nothing Then
    Cell.Offset(0, 1) = objPing.ProtocolAddress
    Cell.Offset(0, 2) = objPing.ResponseTime & " ms"
    Cell.Offset(0, 3) = GetPingStatus(objPing.StatusCode)
    End If
    Next objPing

    thoughts? thanks!

  5. #5
    Registered User
    Join Date
    04-07-2011
    Location
    Philadelphia Pa
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Ping Host Name Column A IP address Result column B Response time Column c

    Kinda on the same topic, maybe in reverse. How would i go about creating a subnet scanner? Would return items from DNS such as Host name, IP address, status based on a subnet. ex. 10.10.10.0 - 10.10.10.255.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Ping Host Name Column A IP address Result column B Response time Column c

    Nickmac,

    This is an old thread. Please create a new thread and provide a link to this one if required.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1