Avatar of Andreas Hermle
Andreas HermleFlag for Germany

asked on 

Apply column widths of currently selected table to all tables using VBA

Dear Experts:

I got a document with ...
... hundreds of tables.
... all of them have the exact same number of columns

Now I would like to manually adjust the column widths in just one (1) table and then by running the macro (with the cursor residing in the table whose columns got adjusted), the column widths of the currently selected table are applied to all of the remaining tables.

Is it possible to run such a macro?  

And one more thing: One of the documents may have tables with just 3 columns, other documents may have tables with 7 columns (as I stated before, all of the tables in the documents have the same number of columns). The macro should be able to accommodate any numbers of columns. .

I wonder whether this is possible? Help is much appreciated. Thank you very much in advance.

Regards, Andreas
Microsoft Word

Avatar of undefined
Last Comment
Andreas Hermle
Avatar of Steven Harris
Steven Harris
Flag of United States of America image

One of the documents may have tables with just 3 columns, other documents may have tables with 7 columns

(as I stated before, all of the tables in the documents have the same number of columns). The macro should be able to accommodate any numbers of columns.

Can you clarify this?  Do they all have the same number of columns or not?
Avatar of Andreas Hermle

ASKER

HI ThinkSpaceSolutions:

I would like to run the macro on different documents.
In one document for example all of the tables have 3 columns,
in another document all of the tables have 7 columns
in another document all of the tables have 2 columns
etc.

So the macro should be able to do its work in all documents. Within one document all tables have the same number of columns, between documents they can vary.

Thank you. Regards, Andreas
ASKER CERTIFIED SOLUTION
Avatar of Chris Bottomley
Chris Bottomley
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Andreas Hermle

ASKER

Chris,

great job, Chris. Thank you very much for your professional help.

Regards, Andreas
Microsoft Word
Microsoft Word

Microsoft Word is a commercial document editing program that is part of the Microsoft Office suite. It features numerous text-editing tools for creating richly formatted documents, along with tools for the use of macros in Word documents. Word's native file formats are denoted either by a .doc or .docx file extension. Plugins permitting the Windows versions of Word to read and write formats it does not natively support, such as the OpenDocument format (ODF) are available. Word can import and display images in common bitmap formats such as JPG and GIF. It can also be used to create and display simple line-art.

30K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo