Auto fit table copied from excel to single page in word

goofy78270

Well-known Member
Joined
May 16, 2007
Messages
555
I currently have a macro that adjust the width for columns of a given range and then copies all rows to a word document. In doing this, I have some table that exceed a single page and was wondering if it is possible to shrink the table, vertically only, to fit it to a single page.

I can shrink the table in word by simply holding the lower right corner and adjusting the size, but when I try to record this action, the option to adjust the size is not available; you gotta love the recording ability in word.

Code:
.....
'To fill the page, each Column must be 14.43 or 106 pixels
If ws.Name <> "Profile Index" Then ws.Range("B:H").ColumnWidth = 14.43
            
 'Copy Selected range of each worksheet
If ws.Name = "Profile Index" Then
   ws.Range("B2:W" & LR).Copy
   With appWord
       'Paste copied range into Word Document
       .Selection.Paste
       .Visible = True
       .Activate
                
       'Insert Break after Index
       .Selection.InsertBreak (wdPageBreak)
   End With
Else
  ws.Range("B2:H" & LR).Copy
            
  With appWord
     'Paste copied range into Word Document
     .Selection.Paste
     .Visible = True
     .Activate
    
.....
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Sorry to bump this in such a short time, but this is the last step to this macro before I am done. Any ideas?
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top