Inserting columns in rows with some text

M

malyjohn

Hello!
I have a following problem. I have in Word a table with following rows:

John
180cm 65kg 20/17 ws
Mike
178cm 75kg 30/15 ns
198753 198765 123 qd
Kevin
no data
Tom
173cm 73kg 40/18 es
....

I would like to insert columns in some of rows to get something like
that

John
180cm | 65kg | 20/17 | ws
Mike
178cm | 75kg | 30/15 | ns
198753 | 198765 | 123 | qd
Kevin
no data
Tom
173cm | 73kg | 40/18 | es
....
My table counts more than thousand rows so this makes way "by hand"
useless.
Is there any way in VBA to achieve that?
Thank you in advance
John Maly
 
J

Jim May

Just highlite the area in Word, Copy it -- Go to a new workbook sheet1
cell A1 and Paste.
Everything might well be in Column A only
Highlight Col A from A1:A1000 (to the end) and
at the menu, click on Data, Text to columns..
follow wizard thru
Write back if problems..
HTH
 
M

malyjohn

Thank you for the tip but I know that is one of the solution.
What I'm looking for is some way in Excel VBA to check row by row of
the table and if row satisfies some conditions insert colums with given
width.
Any idea?
John Maly
 
J

Jim May

My idea is still to drop the info, use text to columns (with spaces as
delimiter);
then as a last-step use VBA (to loop through) testing and making modifications
where needed.
 
M

malyjohn

Ok, but I don't know VBA so can you write me code which can test and
modify rows and columns in my table (example is in my first post)?
Thank you in advance
John Maly
 

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