Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Excel Marco for IP Address

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

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Excel Marco for IP Address


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)

wrote in message
ps.com...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
Convert Word address list to Excel Mluera Excel Discussion (Misc queries) 2 November 2nd 08 11:08 PM
how do I add a 'web address' to a cell in excel with a hyperlink? sandie white New Users to Excel 1 February 8th 06 01:30 PM
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER MEGTOM New Users to Excel 5 October 27th 05 03:06 AM
Word address labels to Excel Columns jlbowman Excel Discussion (Misc queries) 4 February 9th 05 06:51 PM


All times are GMT +1. The time now is 09:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"