Excel - IP address to Integer
Had a need to be able to quickly convert about 500 IP addresses into their integer forms. Addressed the need with this Excel function..
Function IP2Dec(ip As String) Dim dec1, dec2, dec3, dec4 As Integer Dim str As Variant str = Split(ip, ".") dec1 = str(0) * 2 ^ 24 dec2 = str(1) * 2 ^ 16 dec3 = str(2) * 2 ^ 8 dec4 = str(3) * 2 ^ 0 IP2Dec = (dec1 + dec2 + dec3 + dec4) End Function












