Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / August 2006

Tip: Looking for answers? Try searching our database.

Excel Marco for IP Address

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jamesbehling@gmail.com - 17 Aug 2006 18:15 GMT
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
Bob Phillips - 17 Aug 2006 19:05 GMT
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

Signature

HTH

Bob Phillips

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

> 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
[quoted text clipped - 14 lines]
>           delete row
>      End If
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.