Reply
 
Thread Tools Display Modes
  #1   Report Post  
Bill Sturdevant
 
Posts: n/a
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I find out the address of a cell in a very large Word table Terry Tables 1 June 22nd 05 12:44 AM
Placing 1st table into a cell within 2nd table kathryngriffin1962 Tables 2 June 2nd 05 04:09 AM
Find and Replace anomaly BruceM Microsoft Word Help 7 January 18th 05 05:47 PM
word table cell resize or word table cell size change or word table change cell size [email protected] Tables 0 January 13th 05 09:55 PM
Shading does not fill entire cell Fred Holmes Tables 1 October 28th 04 10:18 PM


All times are GMT +1. The time now is 08:46 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"