' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
net = "81.7.128.0"
host = "81.7.129.240"
bits = 18
parts = Split(net, ".")
netval = CLng(parts(0)) * 256 * 256 * 256 + CLng(parts(1)) * 256 * 256 + CLng(parts(2)) * 256 + CLng(parts(3))
parts = Split(host, ".")
hostval = CLng(parts(0)) * 256 * 256 * 256 + CLng(parts(1)) * 256 * 256 + CLng(parts(2)) * 256 + CLng(parts(3))
netsize = 2 ^ (32 - bits)
If (netval <= hostval) And (hostval <= netval + netsize - 1) Then
    MsgBox "Same net"
Else
   MsgBox "Different net"
End If
