Macro to select ALL tables (with different styles) in a word docum

V

Von Stussi

sorry if it is a repost(?)

How to select ALL the tables (with different Table styles) in a word
document (by exemple to apply a "table formatting macro" or a new table style
to all the tables in the document at once).

I cannot select all the tables at once using the Styles and Formatting pane
because the documents have several table with different table styles.
I would like to avoid scrolling in the document and hold the CTL key + click
in every tables.

I have looked for selecting all the tables using the the Find (F5) function
in word, but I found "tables" nowhere in the options list.

Is there is a solution with the Find function or/and with a Macro?

Not sure if I explain well, so ask me if you need further precisions.


Thanks
 
H

Helmut Weber

Hi Stussi,

like that:

Sub Macro2()
Dim oTbl As Table
For Each oTbl In ActiveDocument.Tables
oTbl.Style = "Table Columns 2"
' more options
Next
End Sub

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
 
M

MT

Hi Helmut,

Thanks for the Macro, however that is not what I am looking for. I try to be
more explicite in this post:

(start)
I need a Macro to select ALL the table in a word doc (word2003) as if I was
CTRL + selecting all the table in the doc one after one till to have all
blackened on screen - i.e. selected. No more than that.
(end)

I am sorry, the first post is somewhat confusing. What I meant by: [...] to
apply a "table formatting macro" [...] refered only to apply some Macros I
made to format the tables afterward.

Best Regards,

Mark Von Stussi
Osaka, Japan
 
M

MT

By the way, your Macro is of a good use when I want to apply any word styles
or mines directly. So, thanks again.

The Macro I need to select ALL the table should allow me apply direct
formatting at once in a doc I believe. It is a good alternative for me.

Cheers,

Mark Von Stussi
 
G

Graham Mayor

You can only select the tables one at a time - as in Helmut's macro.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

MT

Thanks you for your answer Grahm Mayor,
Helmut's macro select all the tables in the document and apply a formatting
style. I would like to select all the table without applying a formatting
style. Just have them selected.

Shall I understand your answer as: it can be done this way??

Best regards,
Mark
 
G

Graham Mayor

You can only select one table at a time.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
D

Duane

I don't know if that's true with earlier versions, but I'm using Word 2007
right now and have selected multiple tables, using ctrl+click.
Is there a "SELECT" command that could be used in the macro given above?
Thanks,
D.G.
 
M

macropod

Hi Duane,

In earlier versions (eg Word 2000) you can't select more than one table at a time - unless you also select whatever is between them.
Even so, simply changing 'ActiveDocument.Tables' to 'Selection.Tables' is enough to limit the macro's scope to the tables in the
selected range.
 

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