A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old October 12th, 2009, 04:58 AM posted to microsoft.public.word.tables
Rae
external usenet poster
 
Posts: 66
Default How do I create a Macro for a table that allows it to expand/hide

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?

  #2  
Old October 12th, 2009, 07:10 AM posted to microsoft.public.word.tables
Graham Mayor
external usenet poster
 
Posts: 18,297
Default How do I create a Macro for a table that allows it to expand/hide

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Rae wrote:
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?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:37 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.