# vba paste range to word  keeping column width



## Roger G (Dec 22, 2016)

Hello,

I have a macro that copies a range of cells (I can’t create it as a table, because some cells are merged) and pastes it to a Word. I can’t paste it as image neither because it needs to be able to be modified later in Word.

I want it to keep  the columns width, it works fine except when a cell contains a text larger than the width of the cell (with distributed alignment i excel), as when it is pasted to word,  the column modifies its width to keep the text in just one line.


I have tried different options, like objWord.Selection.PasteSpecial xlPasteColumnWidth or objWord.Selection.PasteAndFormat (wdFormatOriginalFormatting), but none works as i want.

I have tried manually and what i need is to to paste like “link & keep source formatting”

Any ideas?

Thanks

Apologies if there are some mistakes, English is not my mother tongue


----------



## Macropod (Dec 23, 2016)

If you need what is pasted to faithfully represent the Excel workbook, as per paste link (but without the link), use:
.PasteSpecial Link:=False, DataType:=wdPasteOLEObject, Placement:=wdInLine, DisplayAsIcon:=False


----------



## Macropod (Dec 25, 2016)

Another option would be to use:
.PasteExcelTable LinkedToExcel:=False, WordFormatting:=False, RTF:=True
This creates a table in Word that has the same formatting as the Excel range, including text wrapping, etc.


----------



## Roger G (Dec 25, 2016)

Thank you!
The fist one dind't work, it pasted the range as a image, but the .PasteExcelTable LinkedToExcel:=False, WordFormatting:=False, RTF:=True worked fine


----------



## Macropod (Dec 25, 2016)

Roger G said:


> The fist one dind't work, it pasted the range as a image


It actually pastes the range as an embedded Excel workbook, with full Excel functionality, not as just an image.


----------

