+ Reply to Thread
Results 1 to 6 of 6

Macro to periodically check cells for delimiter to parse if needed

  1. #1
    Registered User
    Join Date
    06-26-2013
    Location
    Grand Rapids, MI
    MS-Off Ver
    Excel 2007
    Posts
    3

    Macro to periodically check cells for delimiter to parse if needed

    I have a spreadsheet with a lot of values being added. Some of these values are single numbers, some are multiple values in a single cell, delimited by a colon. I need a macro that can run in the background of the spreadsheet, so that whenever a cell is closed after being edited, it checks for a colon and parses multiple values to new columns if necessary. Is that possible? Thank you

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to periodically check cells for delimiter to parse if needed

    So if I typed 1:3:5 in cell A1, you'd want that split out to 1 in A1, 3 in B1 and 5 in C1? Can you provide specific columns where this needs to be active and exact examples of where the data should parse out to?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    06-26-2013
    Location
    Grand Rapids, MI
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Macro to periodically check cells for delimiter to parse if needed

    Yes, that's exactly what I want. The problem is, I can't necessarily say what columns will have the data that needs to be parsed. I know what rows, but not which columns. That's why I wondered if there was a way I could just have every cell checked after data was entered. It would be fine if they just parse to the cells immediately beside them in the row, the way you described in the example. Is that even possible?

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to periodically check cells for delimiter to parse if needed

    This is most basic form of a Worksheet_Change event you can install into the Sheet module, it will watch for any strings entered with colon as a delimiter and split them out from the cell entered to the right. Be careful, though. Trying to enter 1:3 in Excel often converts that to a Time of 1:03 AM and that one won't split.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-26-2013
    Location
    Grand Rapids, MI
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Macro to periodically check cells for delimiter to parse if needed

    Thanks so much! That's exactly what I needed it to do

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to periodically check cells for delimiter to parse if needed

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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