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.
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
.....