Hiding cells and rows in tables

M

Miked

I will have a document with multiple tables in it. I need to show/hide
rows and columns in the table based on content in the rows or tables.
The process will be:

1. identify which row/column to show/hide
2. execute code to show/hide

I'd like to create a macro to do this, so I'll need the vba code. I
will also need code to show all hidden fields in a document.

Thank you in advance for your help. I am a newbie at the MSWord object
model, so any help you could give would be greatly appreciated.

Thanks again!
 
D

Dawn Crosier

The easiest way to get started with programming your own solution
is to record yourself performing the actions yourself.

So, according to the steps you indicated below, you will want to
learn some keyboard commands, since when the macro recorder is
on, there is very little that you can do with your mouse.

CTRL+F - opens the find dialog box, Enter in your requirements
and press ENTER. Pressing the ESC key will make the find dialog
box close down.
You should have identified a table entry. From the Table menu,
select Select and then select ROW or COLUMN. If necessary, then
hold down your shift key which will enable you to EXTEND your
selection.

Hide your row or column.
I would then stop your macro recorder and inspect your code.

Then I would record a second macro to toggle the hidden fields.
To toggle the hidden fields in your document, click the Show/Hide
icon on your Standard toolbar.
Stop your macro and inspect your code.

To learn how to loop your code, you may want to step through
this:
http://word.mvps.org/faqs/customization/ReplaceAnywhere.htm

I hope that helps. If you get stuck, post back and include the
code you have so far.
--
Dawn Crosier
Microsoft MVP
"Education Lasts a Lifetime"

This message is posted to a newsgroup. Please post replies and
questions to the newsgroup so that others can learn as well.

I will have a document with multiple tables in it. I need to
show/hide
rows and columns in the table based on content in the rows or
tables.
The process will be:

1. identify which row/column to show/hide
2. execute code to show/hide

I'd like to create a macro to do this, so I'll need the vba code.
I
will also need code to show all hidden fields in a document.

Thank you in advance for your help. I am a newbie at the MSWord
object
model, so any help you could give would be greatly appreciated.

Thanks again!
 

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