Selectively delete tables

Q

Question Boy

Hello,

I'm looking for some coding help to delete tables based on a criteria.

I have a doc containing a series of tables. I need to delete the one that
have a format 3 rows

row 1 - 3 cols merged together - Table title
row 2 - 3 cols (1 Desc, 2 '--', 3 '--')
row 3 - 3 cols (1 Empty, 2 '--', 3 '--')

Also, the cells that display '--' are in fact formulas which have a value =
0 and whose formula = $#,##0;($#,##0);'--'

So I am trying to loop through all the table within the document and delete
only the table whose row2 - Col2 & 3 = '--' and row3 - Col2 & 3 = '--' how
can I do this?

I have the basic loop

intTbl = ActiveDocument.Tables.Count
For t = intTbl To 1 Step -1
intRows = ActiveDocument.Tables(t).Rows.Count
If intRows = 3 Then

End If
Next t

However I don't know how to check the 4 cells for their values to ensure
they are = '--'?

Thank you for your help,

QB
 
Q

Question Boy

I was trying to find a .value like

ActiveDocument.Tables(4).Cell(2, 2).value

but this isn't the case in word...After some searching I found the following
to extract the cell value

ActiveDocument.Tables(4).Cell(2, 2).Range.Text

With a little more coding I should be good.

Thank you,
 
Q

Question Boy

I spoke too soon!

I am able to return the cell value,, however it is returning

--
(a bullet symbol)

on two lines. How can I test for a bullet symbol? where is it coming from?

Thank you.
 
Q

Question Boy

Problem solved!

used the asc() func to determine a numeric value to test against for the
bullet
 

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