How to get the Row object containing text found by Find?

S

stormy

I perform a .Find, either from a Range or Selection, and find text within a
table. I need to reference the entire Row object containing the Cell which
contains the text just found. I can get the entire Table, but I cannot find
a way to get just the Row.

Thanks
J
 
J

Jean-Guy Marcil

stormy said:
I perform a .Find, either from a Range or Selection, and find text within a
table. I need to reference the entire Row object containing the Cell which
contains the text just found. I can get the entire Table, but I cannot find
a way to get just the Row.

You probably get to the Table by doing something like:
expression.Tables(1)
where "expression" is the Range or Selection object of the found text.

Do the same with rows:
expression.Rows(1)

But, if there are vertically megrd cells, this will trigger an error... When
there are merged cells, you can only iterate the Cells collection of a Range
or Selection object, not the Rows or Columns one.
 
S

stormy

Jean-Guy,

Thank you! I never thought to try exp.Rows(1) without a table. It works
perfectly.
 

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