Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-04-2023, 01:05 PM
bblelli bblelli is offline Issue then formatting the tables size Windows 10 Issue then formatting the tables size Office 2021
Novice
Issue then formatting the tables size
 
Join Date: Feb 2023
Posts: 22
bblelli is on a distinguished road
Angry Issue then formatting the tables size

Dears,

I'm facing some troubles when formatting tables using VBA in Microsoft Word.

Basically, I've Word Document with more than 1,000 tables

Each table may have lines with one, four, five, or, six columns.
Each table must have a 15 cm width (no matter the number of columns).

If the table has 6 columns, the distribution of the widths must be:
1st column: 1.4 cm,
2nd column: 1.4 cm,
3rd column: 7.3 cm
4th column: 1.6 cm


5th column: 1.6 cm
6th column: 1.7 cm

If the table has 5 columns, the distribution of the widths must be:
1st column: 1.4 cm,
2nd column: 1.4 cm,
3rd column: 8,9 cm
4th column: 1.6 cm
5th column: 1.7 cm

If the table has 4 columns, the distribution of the widths must be:
1st column: 1.4 cm,
2nd column: 1.4 cm,
3rd column: 10,5 cm
4th column: 1.7 cm

I've been trying to work with the ".setwidth" statement, but it's not working perfectly.

"... .SetWidth ColumnWidth:=CentimetersToPoints(1.71), rulerstyle:=wdAdjustFirstColumn"

Please, check the picture below:
As you can see, the cells are not perfectly aligned.



What's the best way to format tables and make sure that independently of the number of columns they will always be aligned?

Thanks
Attached Images
File Type: png Example.png (10.6 KB, 7 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing font size in tables rogercorke Word Tables 0 01-26-2022 01:39 AM
Slide size issue mjm925 PowerPoint 2 04-08-2019 10:59 PM
PDF Conversion Issue - Background Tiled Image Size Issue dustpie Word 1 10-23-2016 07:33 PM
Issue then formatting the tables size Restrict Formatting Issue - pasted text changes page size bclear16 Word 6 08-22-2016 11:31 PM
Reducing size of tables and graphs Phil Pense Word 0 01-30-2012 05:40 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:00 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft