Link to home
Start Free TrialLog in
Avatar of jkemp761
jkemp761

asked on

Excel VBS ping Question

I am looking to put a button on an excel sheet and have a script of some sort to ping addresses in column D and in Column E whether the ping was successfull or not.  Is this possible in excel?
Avatar of WebDevEM
WebDevEM
Flag of United States of America image

There's a good start to this at http://forums.devshed.com/visual-basic-programming-52/ping-from-vba-328706.html that can give you an idea... Look for post # 13 from GammaRay.  You'd need to create a loop to go through all the rows in Column D with values, run that function and populate the cell 1 to the right.  I'm super busy today but if nobody comes back with a more complete answer I can try to write one up.
Avatar of Steve
Attached is a file with code.

Is this somewhere near?
Ping-IP.xlsm
Well done!  

Using that as a framework, you can do quite a bit to make it fancier if you need... change the color of Cells(x, 5) based on success/fail maybe, just to make it easier to read at a glance.  Maybe make Cells(x,6) the response time, and add a status as it's searching.  Something like this:
 'Address to ping
    strIPAddress = Cells(x, 4)
    Cells(x, 5) = "... testing"

Open in new window

so you know where it is in the list, and if it runs into problems you'll know
If you wish to ping site address such as Google.com see attached:
Ping-IP.xlsm
Avatar of jkemp761
jkemp761

ASKER

Nicely Done Barman! And will accept as solution, One question though, how do I make it skip the first row so I can label the E Column?  

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Steve
Steve
Flag of United Kingdom of Great Britain and Northern Ireland image

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
Im Accepting this solution and posting another question as I want to expand on this but want to give you credit for what you have already done.
The solution provided by Barman has worked flawlessly...