Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How to find out if cell exists via VB
I have a table with multiple rows and multiple columns. I use VB code to
loop through my tables, determine if they are the right type of table, then select a range of cells and merge those selected cells. I look for a predictable value in cell (9,5) to identify the tables I want to work with. Some tables don't have 9 rows or 5 columns, so if I try to reference a cell that does not exist, I get an error. What code can I use to determine if a cell exists as I loop through the tables? Dim pTable as Word.Table Dim pCell as Word.Cell For each pTable in ActiveDocument.Tables If pCell(9,5) exists then 'I need a correct statement here to test for existance Set pCell = pTable.Cell(1, 1) if pCell = "Predictable value" then .......execute code End if End if Next |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I find out the address of a cell in a very large Word table | Tables | |||
Placing 1st table into a cell within 2nd table | Tables | |||
Find and Replace anomaly | Microsoft Word Help | |||
word table cell resize or word table cell size change or word table change cell size | Tables | |||
Shading does not fill entire cell | Tables |