Blank Table Cell

M

Mary Fetsch

In my Word 2000 VB, I'm trying to check the contents of a
table cell to determine if the cell is blank. I've tried
using IsNull, IsEmpty, and IsMissing, and none work. When
I display the value of "selection.text", I see 2
rectangles. I've tried checking for that, too, with no
luck. I'll appreciate any help anyone can give me on this!

Mary Fetsch
 
S

Steve Yandl

Mary,

Check the text in the range or selection (depending on how you're
referencing the cell in question) to see if it equals Chr(13) & Chr(7) which
is the case if the cell is empty.

Steve
 
J

Jeff Hall

In that case if len(selection.text)>2 the cell has contents

--------------------------------------------------------------------
Jeff Hall MSc MRICS
Director, Eon Commerce Ltd.
http://www.eon-commerce.com

Software available for you to evaluate before buying...
EasyHTML/Help CHM file Editor for MS Word
http://www.easyhtmlhelp.com
--------------------------------------------------------------------
 
J

Jeff Hall

In that case if len(selection.text)>2 the cell has contents

On second thoughts, it may be that the end of cell marker... Chr(10)Chr(7),,
may return length=1. Test it.

--------------------------------------------------------------------
Jeff Hall MSc MRICS
Director, Eon Commerce Ltd.
http://www.eon-commerce.com

Software available for you to evaluate before buying...
EasyHTML/Help CHM file Editor for MS Word
http://www.easyhtmlhelp.com
--------------------------------------------------------------------
 
J

Jeff Hall

I've now tested this

1. Select the cell
2. if len(selection.text)>2 then cell contains something
3. end of cell marker is Chr(13)Chr(7) [not Chr(10)Chr(7)]
and has a character length = 2
 
M

Mary Fetsch

Thanks so much, Steve!

Steve Yandl said:
Mary,

Check the text in the range or selection (depending on how you're
referencing the cell in question) to see if it equals Chr(13) & Chr(7) which
is the case if the cell is empty.

Steve
 
M

Mary Fetsch

Thanks for the time you've taken with this. I now have 2 ways to check for
this!

Jeff Hall said:
I've now tested this

1. Select the cell
2. if len(selection.text)>2 then cell contains something
3. end of cell marker is Chr(13)Chr(7) [not Chr(10)Chr(7)]
and has a character length = 2


--------------------------------------------------------------------
Jeff Hall MSc MRICS
Director, Eon Commerce Ltd.
http://www.eon-commerce.com
--------------------------------------------------------------------
On second thoughts, it may be that the end of cell marker...
Chr(10)Chr(7),, may return length=1. Test it.
 

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