Excel Marco for IP Address

J

jamesbehling

I have a list of servers in column A, some of the server names are IP
addresses. I need a macro that will determine if the server name
listed is an IP address and if so, do a specfic action.

Example Spreadsheet
A
1 10.2.5.99
2 10.2.5.33
3 34Bob
4 Geroge
5 Luke

Psuedo Code
Check value of column A, Cell X
If value = IP address
copy entire row to other worksheet
delete row
End If
 
B

Bob Phillips

Sub Test()
Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To iLastRow
If Len(Cells(i, "A").Value) - (Len(Replace(Cells(i, "A").Value, ".",
""))) = 3 Then
If IsNumeric(Replace(Cells(i, "A").Value, ".", "")) Then
'do something"
End If
End If
Next i


End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

ip address 0
IP address to Hostname in Excel 16
Search and Combine Rows 4
Filtering data 2
Excel VBA macro, search - accumulate - delete original 0
Auto duplicate rows 0
Automatically modify cell data 1
macro 3

Top