Convert Text String to Cells

J

John Ford

A newbie question: What's a good way to format and process a text string to get it into a row of cells? Is there an excel method that parses strings into cells?

My excel macro gets a string from another application. The string is to be parsed into multiple cells within one row. I control the othe application, so I can build the string however I want. Should I use CSV? XML? Just put vbCrLf between data items?

Right now the string I'm parsing is CSV:

"item1","item2","etc.."

My macro has no idea how many items to expect - I just want it to put them in consecutive cells in the current row.

-jcf
 
P

Peter Bobrowski

highlight the text and click the data menu and choose text to columns,
follow the prompts for your situation.

A newbie question: What's a good way to format and process a text string to
get it into a row of cells? Is there an excel method that parses strings
into cells?

My excel macro gets a string from another application. The string is to be
parsed into multiple cells within one row. I control the othe application,
so I can build the string however I want. Should I use CSV? XML? Just put
vbCrLf between data items?

Right now the string I'm parsing is CSV:

"item1","item2","etc.."

My macro has no idea how many items to expect - I just want it to put them
in consecutive cells in the current row.

-jcf
 
S

steve

John,

Under the Data menu is an option for Text to Columns.
Manually copy and paste your text into a cell and play with this option.
After you get used to it - record a macro, than modify the recorded macro to
suit your needs.

steve

A newbie question: What's a good way to format and process a text string to
get it into a row of cells? Is there an excel method that parses strings
into cells?

My excel macro gets a string from another application. The string is to be
parsed into multiple cells within one row. I control the othe application,
so I can build the string however I want. Should I use CSV? XML? Just put
vbCrLf between data items?

Right now the string I'm parsing is CSV:

"item1","item2","etc.."

My macro has no idea how many items to expect - I just want it to put them
in consecutive cells in the current row.

-jcf
 
J

John Ford

Hello? My macro is a VBA program that gets the string from another application - this isn't a user pointin' and clickin'. ;-)

HOWEVER... your reply lead me to do the old "record a macro and see how it works" techique. Sure enough, there's a myRange.TextToColumns method which it looks like it will do the trick.

Thanks,
-jcf

| highlight the text and click the data menu and choose text to columns,
| follow the prompts for your situation.
|
| | A newbie question: What's a good way to format and process a text string to
| get it into a row of cells? Is there an excel method that parses strings
| into cells?
|
| My excel macro gets a string from another application. The string is to be
| parsed into multiple cells within one row. I control the othe application,
| so I can build the string however I want. Should I use CSV? XML? Just put
| vbCrLf between data items?
|
| Right now the string I'm parsing is CSV:
|
| "item1","item2","etc.."
|
| My macro has no idea how many items to expect - I just want it to put them
| in consecutive cells in the current row.
|
| -jcf
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top