Click Format and then Table Properties.Select Modify Table Style from the context menu.Find the one you need (expanding the dropdown if necessary), and right-click. You should see some table styles in the center of the ribbon.You should see the Table Tools tabs appear on the ribbon. You can just click Insert Table from the Insert tab and insert a table with a couple cells. In a Word document, create a basic table.Let's say you are using the Light Shading table style (this is the first Table Style that I see when I expand Table Styles from the ribbon). Since you say you are using existing styles, you can modify them so that the table is centered. In Word, you can create or modify table styles. So, I'm going to try to explain how I would do the first part of this. Range(Cells((26 * (i - 1) + 17), 1).Address, Cells(((26 * (i - 1) + 25)), 3).Address).CopyĪs you can see, this code copy paste 3 tables at one interaction, that is 600 tables in total! So, it gets very boring to center one by one. Selection.PasteExcelTable True, False, False Selection.PasteAndFormat (wdFormatPlainText) Set objWord = CreateObject("Word.Application") 'Copy the range Which you want to paste in a New Word Document Does anyone knows how to do it? Going to post my code here: Sub excel2word() It's working, but the problem is that all tables are pasted left-aligned and I want it center aligned. ![]() I'm very new to VBA and my first code is to copy excel tables and paste it at word.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |