Subnet calculator for MS Excel

microsoft excelsubnet

I quite often use the handy subnet calculator here:

http://www.subnet-calculator.com/

Which I find very useful. However, does anyone have details/a link for a version of this that offers similar functionality but is in an excel spreadsheet.

I could then include it in a worksheet and I wouldn't have to keep visiting the website. Also handy if I don't have internet access – which can often be the case when I need it.

Best Answer

The following function (that calls Marcus Mansfield's IPSubnetCalc) will output a network range when given a subnet:

    Public Function IPRange(IPandMaskInput$)

    ' PROGRAM:
    ' IP Range Calculator by Tomas Pospisek that uses Marcus Mansfield's IPSubnetCalc
    '
    ' INPUTS:
    ' Input Expected xx.xx.xx.xx/yy
    ' Where xx = decimal IPv4 Octet
    '       yy = BitMask Value ( 0 - 32 ex.31 )
    '
    ' OUTPUT:
    ' IP Range in the form: "aa.aa.aa.aa - bb.bb.bb.bb"

        Range_From = IPSubnetCalc(4, IPandMaskInput)
        Range_To = IPSubnetCalc(5, IPandMaskInput)

        IPRange = Range_From & " - " & Range_To
    End Function
Related Topic