How do I create a Macro for a table that allows it to expand/hide

R

Rae

I am wanting to create a series of tables that display only their headings
until the heading is selected initiating a Macro which expands the hidden
data within the table.
Has anyone done anything similar to this/ know how to create this macro?
 
G

Graham Mayor

You could create the heading as a macrobutton field to call a macro similar
to

Sub ToggleCells()
With Selection.Tables(1)
.Cell(2, 2).Range.Font.Hidden = Not _
.Cell(2, 2).Range.Font.Hidden
End With
End Sub

which will toggle the display the content of cell column 2 row 2 in the
current table.

or

With Selection.Tables(1)
.Rows(2).Range.Font.Hidden = Not _
.Rows(2).Range.Font.Hidden
End With

which will toggle the display of row 2


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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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