' Purpose: Copy an Excel range to a Word table with some basic formattingĮnd With Set wordTable = wordDoc. Of course if your Excel range is too big for one page it will not make any magic. If you are copying multiple Excel ranges to Word tables and you would like to keep the individual tables on one page, you have to tick “keep with next” and “keep lines together” in paragraph options. = wdCellAlignVerticalCenterĮnd With Keep Word table on the same page Then move forward to the table formatting: Set wordTable = wordDoc.tables( 1) BottomMargin = CentimetersToPoints( 1.5) Formatting Word table via ExcelĪt first, if necessary, I play around with Word document margins: 'set margins of the Word document
HOW TO COPY AND PASTE IN WORD TABLE CODE
Usually I format the table in Word making notes about the formatting steps then code in Excel VBA (if you have a better approach please share :)). The steps are the same for Word 2021, Word 2019, and Word 2016 and similar for Word 2013 and Word 2010. The images below are from Word for Microsoft 365.
![how to copy and paste in word table how to copy and paste in word table](https://cdn-adclh.nitrocdn.com/zciqOWZgDznkuqFpvIJsLUeyHlJtlHxe/assets/static/optimized/rev-ae61699/wp-content/uploads/2021/07/Data-to-copy-from-Excel-to-Word.png)
HOW TO COPY AND PASTE IN WORD TABLE HOW TO
Same problem when I use local Numbers, it paste in one same column. If you want to copy comments separately from the text or other Track Changes, visit How to Copy and Paste Comments into a New File in Microsoft Word. But, this way with word is very harsh and timewasting. But, when copy table from excel to word, and than to InDD - it works. It always depends on your range (how many columns, rows, content etc.). Copy table from excel and than paste it to InDD - it pastes all data in the same column. So it is obvious the Word table needs some formatting. Though the result will look ugly, something like below: ' -ĭim paragraphCount As Long Set sh_source = ThisWorkbook.Sheets( "SourceToCopy")ĪppWord.Visible = True 'create new word doc ' Purpose: Copy an Excel range to a Word table without formatting This post is an add-on to a previous post I wrote covering how to copy & paste a single Excel table into a Word document.I received a bunch of questions asking how to modify the code to handle copying multiple Excel tables to a Word document.
![how to copy and paste in word table how to copy and paste in word table](http://2.bp.blogspot.com/_79SognVSu7A/TDNyWLJEJQI/AAAAAAAAB5o/KwRjkkZFdvI/s1600/Copy+Excel+Table+on+PowerPoint.png)