- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
        
|
¦^´_ 8# loveinput
¦P®É¶]¨âÓµ{¦¡! (µ{¦¡°õ¦æ®É,²¾°Ê·Æ¹«,Áä½L,©ö¥X¿ù)- Option Explicit
- Sub Ex_Ping()
- Dim AR(), Rng As Range, R As Integer, C As Integer, termPing As Object, termStatus As Variant
- With Worksheets("Sheet1")
- Set Rng = .Range("C2", .Range("C2").End(xlDown)).Resize(, .Range("C1").End(xlToRight).Column - 2)
- AR = Rng 'Âà¤J°}¦C
- End With
- For R = 1 To UBound(AR) '°}¦C:²Ä¤@ºû(¦C)
- For C = 1 To UBound(AR, 2) Step 2 '°}¦C:²Ä¤Gºû(Äæ) Step 2 ¶¡¹j 2Äæ
- Application.StatusBar = AR(R, C)
- Set termPing = GetObject("winmgmts:").ExecQuery _
- ("Select * from Win32_PingStatus where Address = '" & AR(R, C) & "'")
- For Each termStatus In termPing
- With termStatus
- If IsNull(.StatusCode) Or .StatusCode <> 0 Then ' Terminal¥¢±Ñ
- AR(R, C + 1) = "Termin 3G¤£³q" ' termresResult = "Time Out"
- Else ' ¦¨¥\
- AR(R, C + 1) = "Termin 3G³q" ' termresResult = .ResponseTime & "ms" '¨ú±oATUR¦^À³®É¶¡
- End If
- End With
- Next
- Next
- Next
- Rng = AR '¾É¥X°}¦C
- Application.StatusBar = "OK"
- End Sub
½Æ»s¥N½X |
|