Table with merged cells

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Table with merged cells

Post by Robie »

Hi

Is there any way to determine if some cells in a table are merged under VBA (if possible)? For example, if I select a table under VBA is there a way to determine if it contains merged cells?

Thanks.
Robie

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Table with merged cells

Post by Rudi »

See this page.
Two macro options to locate merged cells half way down the page...
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78592
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Table with merged cells

Post by HansV »

Hi Rudi,

That page is for Excel. Robie's question is about Word...
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Table with merged cells

Post by Rudi »

Oops...sorry, I didn't notice the forum Robie was posting in!

According to Hans, checking for merged cells in a Word table is not really possible except for a "for what it's worth..."
See this thread...
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
macropod
4StarLounger
Posts: 508
Joined: 17 Dec 2010, 03:14

Re: Table with merged cells

Post by macropod »

You could test the table with code like:
ActiveDocument.Tables(1).Uniform
where 1 is the table #. If the table contains merged cells, or different width columns, the result will be False.
Paul Edstein
[Fmr MS MVP - Word]

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: Table with merged cells

Post by Robie »

macropod wrote:You could test the table with code like:
ActiveDocument.Tables(1).Uniform
where 1 is the table #. If the table contains merged cells, or different width columns, the result will be False.
Thanks Paul. I will give this one a go.

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: Table with merged cells

Post by Robie »

Thanks Rudi and Hans for trying at least.

I am going to try Macropod's suggestion to see if it works.