View Single Post
  #1   Report Post  
Bill Sturdevant
 
Posts: n/a
Default Select specific cells in table via macro

I have a table in Word XP that was created by Pasting Special (HTML) from an
Excel spreadsheet. The first and second rows of the table span the entire
width of the table (merged cells). The remaining rows have cells of varying
widths in many of the rows (not always the same widths down through the
table).

I have created a macro that will do various reformatting (such as shrinking
the width, specifying the border for the table, things that can be done while
in the Table Properties dialog box). Shrinking the width, however, causes
some columns to be sized improperly in some rows depending upon the values in
those cells.

What VB code can I use to select the cells in rows 3 and 4 of column 1 and
then shrink the column width (which simultaneously expands the width of
column 2 of the same rows)?

I have tried to record a macro, but recording a macro does not seem to work
when working directly on a table.

Alternatively, how can I record a macro while working within a table?