Results 1 to 2 of 2

Thread: Split values in Cell D onto next line??

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2002
    Location
    Hampton Beach
    Posts
    513

    Question Split values in Cell D onto next line??

    My Excel spreadsheet is setup like this:

    Cell A Cell B Cell C Cell D
    John Smith Yes Alberta,Ontario,Quebec

    How can I code it so that I can turn that into this:

    Cell A Cell B Cell C Cell D
    John Smith Yes Alberta
    John Smith Yes Ontario
    John Smith Yes Quebec

    Basically take the values in Cell D (where there is a comma) and it add to the next row containing the other values in Cell A, B, and C

    Help is appreciated.....

    Johnny

  2. #2
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    THe basic idea would be:
    Read in your line (each cell in a StringVar).
    split the String in Cell D into a StringArray. If this array has only one item, just refill the line again, if it has more items fill a line with all the StringVars and in Cell D just one of the StringArray-items at a time (you need to insert a line for all the additional items).
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

Posting Permissions

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



Click Here to Expand Forum to Full Width