Avatar of Keith McElroy
Keith McElroy

asked on 

vb script equalizing width of rows

I have tables that are 6 columns in most rows and 1 merged column in other rows
I am deleting the 6th column if it exists.
Then, I want the one merged column row to be the same width.
The following code errs saying trw.width is not a valid property

How do I fix this code...

                        dim tblwidth
                        if tbl.Columns.count > 5 and then
                              for each trw in tbl.rows
                                    if trw.cells.count > 5 then
                                          trw.cells(6).Delete   'this works
                                          tblwidth = trw.width       'this fails
                                          
                                    end if
                                    
                                    if trw.cells.count = 1 then
                                    
                                          trw.width = tblwidth  'this will make the merged column row same width as the rows above that were trimmed down to 5 columns.
                                          
                                    end if
                              next
                              
                        end if
VB ScriptMicrosoft Word

Avatar of undefined
Last Comment
Neil Fleming
ASKER CERTIFIED SOLUTION
Avatar of Neil Fleming
Neil Fleming
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
VB Script
VB Script

VBScript (Visual Basic Scripting Edition) is an interpreted scripting language developed by Microsoft that is modeled on Visual Basic, but with some important differences. VBScript is commonly used for automating administrative and other tasks in Windows operating systems (by means of the Windows Script Host) and for server-side scripting in ASP web applications. It is also used for client-side scripting in Internet Explorer, specifically in intranet web applications.

39K
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