Ping The Address İn The Cell Online Excel and Excel Macro (VBA) Courses Copy Macro 'For online Excel courses click: https://www.excelsizeyeter.com/excelwithkenan.com/udemy_giris.php Sub GetIPs() Dim c As Range 'Range("A2:A4") contains the domain names to ping For Each c In ActiveSheet.Range("A2:A4") c.Offset(0, 1) = PingAddress(c.Text) Next c End Sub Function PingAddress(strDomain As String) As String Dim fso As Object Dim WshShell As Object Dim RetVal As Long Dim strTemp As String Dim colOutput As New Collection Dim OutputItem Dim i As Long Set WshShell = CreateObject("Wscript.Shell") RetVal = WshShell.Run("cmd /c nslookup.exe -ls " & strDomain & " > C:NSLOOKUPDATA.TXT", 0, True) Set fso = CreateObject("Scripting.FileSystemObject") Set txtstream = fso.OpenTextFile("C:NSLOOKUPDATA.TXT", 1) Do strTemp = txtstream.ReadLine colOutput.Add strTemp Loop Until txtstream.AtEndOfStream txtstream.Close For i = colOutput.Count To 1 Step -1 If Left(colOutput(i), 10) = "Addresses:" Then strTemp = Trim(colOutput(i)) PingAddress = Trim(Right(strTemp, Len(strTemp) - InStr(1, strTemp, "Addresses:") - 9)) Exit For End If Next If PingAddress = "" Then For i = colOutput.Count To 1 Step -1 If Left(colOutput(i), 8) = "Address:" Then strTemp = Trim(colOutput(i)) PingAddress = Trim(Right(strTemp, Len(strTemp) - InStr(1, strTemp, "Addresses:") - 9)) Exit For End If Next End If If PingAddress = "" Then PingAddress = "Domain name not resolved" Set txtstream = Nothing Set fso = Nothing Set WshShell = Nothing End Function Report problem with this macro This macro does not work. There's an error in the code. Other You can write your comments about the error in the box below. Report error ALL MACROS Youtube Channel The following macros may be useful for you. Similar Results NoMacro Name 1 ping the address in the cell 2 search combobox change 3 Getting the full address of the cell along with the sheet / page in the listbox 4 automatically opening the column at the desired width when you click on the cell 5 userform pops up when you click between cells 6 selection of filled fields and finding the last filled cell 7 message or macro according to the value in the cell 8 inserts double zeros at the beginning of numbers entered in specific cells on the active sheet / page 9 Copy and paste cell values by shortcut 10 still inputbox 11 I want to throw the full cells in row with text between a1: an1000 into listbox 12 finds formulas on active sheet / page lists new sheet / page 13 Adding Rows and Total Formula When Cell Changes 14 find and list them in a message 15 Track and Report User Changes in an Excel worksheet or workbook 16 macro running according to condition 17 assigns date to the next line when data is entered in certain cells on the sheet / page 18 Find with Inputbox 19 adding two lines and removing total 20 active cell printing