+ Reply to Thread
Results 1 to 4 of 4

Split the ranges into column vales

  1. #1
    Registered User
    Join Date
    01-10-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Split the ranges into column vales

    I have a sheet where each column has a range of IP's
    I want a marco which should expand the range
    for eg if the range defines is 10.130.212.1-10.130.212.255; i want a macro that should give me a result like below

    10.130.212.1
    10.130.212.2
    10.130.212.3
    and so on........

    Attaching sample sheet for reference
    Attached Files Attached Files

  2. #2
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,279

    Re: Split the ranges into column vales

    Try with following formula. I think macro not need.

    b2: =LEFT(A2,FIND("-",A2)-1)
    c2: =MID(A2,FIND("-",A2)+1,99)

  3. #3
    Registered User
    Join Date
    01-10-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Split the ranges into column vales

    what this does is if the value of A2 is 10.130.212.1-10.130.212.255 then it gives me B2= 10.130.212.1 and C2= 10.130.212.255
    but what i want is
    B2= 10.130.212.1; C2= 10.130.212.2; D2=10.130.212.3; E2= 10.130.212.4 and so on till 10.130.212.255

  4. #4
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,279

    Re: Split the ranges into column vales

    Sakshi Tandon : Sorry for delay in reply. I have work lot of on your formula & i have get solution on that. I have attach file for readyref. The formula is as below.

    "B4": =IF((COLUMN(B4)-COLUMN($B4))>=VALUE(MID(MID($A4,FIND("-",$A4)+1,100),FIND(".",MID($A4,FIND("-",$A4)+1,100),FIND(".",MID($A4,FIND("-",$A4)+1,100),FIND(".",MID($A4,FIND("-",$A4)+1,100))+1)+1)+1,100)),"",LEFT($A4,FIND(".",LEFT($A4,FIND("-",$A4)-1),FIND(".",LEFT($A4,FIND("-",$A4)-1),FIND(".",LEFT($A4,FIND("-",$A4)-1))+1)+1))&TEXT(VALUE(MID(LEFT($A4,FIND("-",$A4)-1),FIND(".",LEFT($A4,FIND("-",$A4)-1),FIND(".",LEFT($A4,FIND("-",$A4)-1),FIND(".",LEFT($A4,FIND("-",$A4)-1))+1)+1)+1,100))+(COLUMN(B4)-COLUMN($B4)),"00"))

    If you satisfy, mark on *.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1