I need to check a string for unwanted characters (only valid HEX characters allowed, 0-9, a-f, A-f)
sub unwantedCHAR()
Dim IPv6_Address As String
IPv6_Address = ThisWorkbook.Names("IPv6_Address").RefersToRange.Value
Dim ipv6_segments() As String
ipv6_segments = Split(IPv6_Address, ":")
ipv6_segments_count = UBound(ipv6_segments) - LBound(ipv6_segments) + 1 If ipv6_segments_count <> 8 Then
MsgBox "The IP address entered for the Westell Remote is not a valid IPv6 address. Expecting 8 segments delimited by a colon )", vbCritical + vbOKOnly
Exit Sub
End If
Dim x As Integer
Dim segLEN As Integer
For x = 0 To 7
segLEN = Len(ipv6_segments(x))
If segLEN > 4 Then
MsgBox ("Segment " & (x + 1) & ", " & ipv6_segments(x) & " is not valid IPv6 segment")
End If
<NEED CODE>
check for characters in IPv6_segments(x) that are not valid HEX characters (0-9, a-f, A-F)
I have tried instr and like statements but cannot get it to work properly, any help appreciated
new to Vba
sub unwantedCHAR()
Dim IPv6_Address As String
IPv6_Address = ThisWorkbook.Names("IPv6_Address").RefersToRange.Value
Dim ipv6_segments() As String
ipv6_segments = Split(IPv6_Address, ":")
ipv6_segments_count = UBound(ipv6_segments) - LBound(ipv6_segments) + 1 If ipv6_segments_count <> 8 Then
MsgBox "The IP address entered for the Westell Remote is not a valid IPv6 address. Expecting 8 segments delimited by a colon )", vbCritical + vbOKOnly
Exit Sub
End If
Dim x As Integer
Dim segLEN As Integer
For x = 0 To 7
segLEN = Len(ipv6_segments(x))
If segLEN > 4 Then
MsgBox ("Segment " & (x + 1) & ", " & ipv6_segments(x) & " is not valid IPv6 segment")
End If
<NEED CODE>
check for characters in IPv6_segments(x) that are not valid HEX characters (0-9, a-f, A-F)
I have tried instr and like statements but cannot get it to work properly, any help appreciated
new to Vba