Hi all,
I've been using the forums for several days to get answers to my questions but finally came across a dead end. Please help!
I'm working with a dataset where there is a whole bunch of text in one cell that I need to parse. There are two delimiters: "~" and ";". Furthermore, there are several line breaks within the cell, which don't necessarily indicate the need for a new cell. For example, cell A1 could look like this:
Dogs~Dogs have 4 legs.;
Humans~Humans have 2 legs.
Humans also have 2 arms.
Humans are have thumbs.;
Fish~Fish have no legs.
With this example cell A1, I would want to separate cell A1 in the following way:
B1: Dogs
C1: Dogs have 4 legs.
B2: Humans
C2: Humans~Humans have 2 legs.
Humans also have 2 arms.
Humans are have thumbs.
B3: Fish
C3: Fish have no legs.
One thing that seems to show some potential is if I run through the "text to columns" wizard setting the proper delimiters, then undo any changes that the wizard made, the file seems to remember the delimiters. From there, I can (1) select cell A1 in the example, (2) push F2, which moves my cursor inside the cell, (3) highlight all of the text, (4) select cell B1, and (5) paste.
The issue with this is that the cells organize like this:
B1: Dogs
C1: Dogs have 4 legs.
B2: Humans
C2: Humans~Humans have 2 legs.
B3: Humans also have 2 arms.
B4: Humans are have thumbs.
B5: Fish
C5: Fish have no legs.
I was thinking maybe I could design a macro with some conditional statements to move and merge cells as necessary, however, step (3) shows up in the VBA code as the actual text rather than a copy command. Plus, I'm really hoping there is a better way to do this!
Please help! Thank you in advance!
I've been using the forums for several days to get answers to my questions but finally came across a dead end. Please help!
I'm working with a dataset where there is a whole bunch of text in one cell that I need to parse. There are two delimiters: "~" and ";". Furthermore, there are several line breaks within the cell, which don't necessarily indicate the need for a new cell. For example, cell A1 could look like this:
Dogs~Dogs have 4 legs.;
Humans~Humans have 2 legs.
Humans also have 2 arms.
Humans are have thumbs.;
Fish~Fish have no legs.
With this example cell A1, I would want to separate cell A1 in the following way:
B1: Dogs
C1: Dogs have 4 legs.
B2: Humans
C2: Humans~Humans have 2 legs.
Humans also have 2 arms.
Humans are have thumbs.
B3: Fish
C3: Fish have no legs.
One thing that seems to show some potential is if I run through the "text to columns" wizard setting the proper delimiters, then undo any changes that the wizard made, the file seems to remember the delimiters. From there, I can (1) select cell A1 in the example, (2) push F2, which moves my cursor inside the cell, (3) highlight all of the text, (4) select cell B1, and (5) paste.
The issue with this is that the cells organize like this:
B1: Dogs
C1: Dogs have 4 legs.
B2: Humans
C2: Humans~Humans have 2 legs.
B3: Humans also have 2 arms.
B4: Humans are have thumbs.
B5: Fish
C5: Fish have no legs.
I was thinking maybe I could design a macro with some conditional statements to move and merge cells as necessary, however, step (3) shows up in the VBA code as the actual text rather than a copy command. Plus, I'm really hoping there is a better way to do this!
Please help! Thank you in advance!