How to delete content in a table

J

juan

Hi, I have a table with 6 columns and variable rows, how to delete the
content of all the cells except the cells in row 1?

Thanks
Juan Uribe
 
T

Tony Jollans

One way ...

With ActiveDocument
.Range(.Tables(1).Rows(2).Range.Start,
..Tables(1).Rows.Last.Range.End).Rows.Delete
End With
 
J

juan

thanks tony, excelent,
Juan Uribe

Tony Jollans said:
One way ...

With ActiveDocument
.Range(.Tables(1).Rows(2).Range.Start,
..Tables(1).Rows.Last.Range.End).Rows.Delete
End With
 
C

Chip Orange

Juan,

Did you want to actually remove the other rows, or just to empty their
cells, but leave them in place?

Chip
 
J

juan

Thanks Chip, I realize that, this way it erases the cell, I changed ...:=1,
Column:=2).row.Delete for ...:=1, Column:=2).Range.Delete and it works
erasing only the content
 
C

Chip Orange

I would have thought that would also delete the rows or columns, so I guess
I don't quite understand how it's working.

My thought was to use:

..range.text = ""

Which would only clear each cell I think.

Anyway, it sounds like you have what you need.

Chip
 
A

Angie M.

Hi Chip,

Sorry to butt in, but I need to delete the contents of a table, I have a
table with 3 columns and 1 row, I need to delete the contents of only the 1st
column and then insert 4 blank paragraphs and the word "lawyers", centered,
all caps. I was searching for my answer and found this post, I'm going to
play with what you gave him so far and see if I can figure it out. thanks!
 

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