+ Reply to Thread
Results 1 to 4 of 4

Excel VBA D1,D2,D3 to D1-D3

  1. #1
    Registered User
    Join Date
    11-07-2019
    Location
    Netherlands
    MS-Off Ver
    2016
    Posts
    8

    Cool Excel VBA D1,D2,D3 to D1-D3

    Hi,

    Im trying to create a code that converts:

    C1001,C1009,C1034,C1117,C1145,C5048,C5056,C6205,C6206,C6207,C6229,C6230,C6231

    TO

    C1001, C1009, C1034, C1117, C1145, C5048, C5056, C6205-C6207, C6229-C6231

    For example.

    So when the nummers add up put a - instead of summing it all up with ,

    so 1,2,3,4,5,6,7,8,9,10 would be 1-10

    It's suppossed to do a complete column on a sheet

    Can you guys help me out a little?

  2. #2
    Valued Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    456

    Re: Excel VBA D1,D2,D3 to D1-D3

    Hi,

    give us a example workbook so we get a better picture of what you mean.
    Are the numbers always in order with gabs in it?
    and where do you want the output?

    Grtz
    Please be as complete as possible in your asking so it may save use all the time to rework the solution because you didn't give all the requirements. If you have a layout in mind please work it out first so we can adapt our solution to it. Thanks.
    If you have been helped, maybe you could click the *

  3. #3
    Registered User
    Join Date
    11-07-2019
    Location
    Netherlands
    MS-Off Ver
    2016
    Posts
    8

    Re: Excel VBA D1,D2,D3 to D1-D3

    Attached some example data.
    The output can go into the same column.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,518

    Re: Excel VBA D1,D2,D3 to D1-D3

    UDF
    C2:
    =GetList(B2)
    Then copy down.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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