Announcement

Collapse
No announcement yet.

Autofill IP ranges (Was: Increase IP address ranges in Excel)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Autofill IP ranges (Was: Increase IP address ranges in Excel)

    I want to create a spreadsheet listing all our IP address ranges on the network so I have a list of what ranged I have.

    Anyone know a formula within Excel to list 10.1.1.1 - 10.10.10.255 without having to enter these manually.

    Thanks

  • #2
    Re: Increase IP address ranges in Excel

    I would suggest 4 columns, then use concatination to merge them with the dots
    Alternatively what about a little Macro:
    Code:
    Sub GenerateIPRange()
    'Fixed to 10.1.1.1 to 10.10.10.255
    'Start in A1
    Dim intSecond As Integer
    Dim intThird As Integer
    Dim intFouth As Integer
    
    Range("A1").Select
    For intSecond = 1 To 10
        For intThird = 1 To 10
            For intFourth = 1 To 255
                Selection.Value = "10." & intSecond & "." & intThird & "." & intFourth
                ActiveCell.Offset(1, 0).Select
            Next intFourth
        Next intThird
    Next intSecond
    End Sub
    You could of course adjust this to take any two IP addresses and fill the range between, also to start in any cell you like, but this is the "quick and dirty" version
    Last edited by Ossian; 16th May 2009, 09:00. Reason: Macro Added
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    PhD, MSc, FIAP, MIITT
    IT Trainer / Consultant
    Ossian Ltd
    Scotland

    ** Remember to give credit where credit is due and leave reputation points where appropriate **

    Comment

    Working...
    X