+ Reply to Thread
Results 1 to 2 of 2

Function for Comma-Separated Values within Cell

  1. #1
    Registered User
    Join Date
    07-12-2014
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    67

    Function for Comma-Separated Values within Cell

    I already have a function to take a comma-separated string within a cell and change the values into dashes (I'll attach the .bas file) Here's an example of how it already works:
    A B C
    1 Comma-Separated Cells "Numdash" Function Result
    2 1,2,3,4,5 =NUMDASH(A2) 1-5
    3 1,2,3,5 =NUMDASH(A3) 1-3,5
    4 1,2,3,5,7,8,9,10,11,12 =NUMDASH(A4) 1-3,5,7-12

    Now I need a way to reverse-engineer it so it takes the dashed values and shows all the numbers between them, like this:

    A B C
    1 Dash-Separated Cells "Numcomma" Function Result
    2 1-5 =NUMCOMMA(A2) 1,2,3,4,5
    3 1-3,5 =NUMCOMMA(A3) 1,2,3,5
    4 1-3,5,7-12 =NUMCOMMA(A4) 1,2,3,5,7,8,9,10,11,12

    Here's a sample of how the macro that I have works;
    NUMDASH.xlsm
    Please Login or Register  to view this content.
    Last edited by SoothSailor; 11-07-2014 at 04:30 PM. Reason: EDIT: Attached file

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Function for Comma-Separated Values within Cell

    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)

Similar Threads

  1. [SOLVED] Compare comma separated values in a cell to a list
    By SMB in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-03-2019, 01:10 AM
  2. Replies: 7
    Last Post: 07-04-2014, 11:52 AM
  3. [SOLVED] Extracting information from a comma separated list of values in one cell
    By cardiff in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-11-2012, 09:17 PM
  4. Replies: 3
    Last Post: 01-13-2012, 08:20 AM
  5. Resolved >>> Comma separated values in a cell
    By usr789 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-25-2007, 08:36 AM

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