I thought I'd add a little to this community. This may have been done before but I searched and didn't see this code. It's not stellar or ground breaking but it is very useful for me.

I use this function to determine if a value passed is a valid IP address or not.

VB Code:
  1. ' Verifies if Data qualifies as an IP address
  2. Function IsIP(IP As String) As Boolean
  3.     'Declarations
  4.     Dim tmpIP As Variant
  5.     Dim Element As Variant
  6.     Dim x As Integer, y As String
  7.    
  8.     'Verify 4 octets
  9.     tmpIP = Split(IP, ".")
  10.     If UBound(tmpIP) <> 3 Then
  11.         IsIP = False
  12.         Exit Function
  13.     End If
  14.  
  15.     'Verify all numerics
  16.     tmpIP = Replace(IP, ".", "")
  17.     For x = 1 To Len(tmpIP)
  18.         y = Mid(tmpIP, x, 1)
  19.    
  20.         If Not IsNumeric(y) Then
  21.             IsIP = False
  22.             Exit Function
  23.         End If
  24.     Next x
  25.  
  26.     'Verify octet values
  27.     tmpIP = Split(IP, ".")
  28.     For Each Element In tmpIP
  29.         If Element > 255 Then
  30.             IsIP = False
  31.             Exit Function
  32.         End If
  33.     Next
  34.  
  35.     'All tests passed
  36.     IsIP = True
  37. End Function