Forum Discussion

Tommaso_Bertocchi's avatar
Tommaso_Bertocchi
Copper Contributor
Sep 19, 2022
Solved

Help with Paste from excel to word

Hi everyone! there is something going on that i really cant figure out.. i have an excell file with a table, few columns lot of rows, and a lot of pictures! if i select the whole 'space/stable' co...
  • Doug_Robbins_Word_MVP's avatar
    Doug_Robbins_Word_MVP
    Sep 22, 2022

    Tommaso_Bertocchi I apologize in advance if this makes you cry.

     

    Using Visual Basic in Word, you can add a table to a document using a command such as

    The table will be added to the Range, which can be defined in a number of ways.  For example if the table was to be added at the end of the document, you would use

     

    Dim NewTable As Table

    Dim tblRange As Range

    Set tblRange = ActiveDocument.Range

    tblRange. Collapse wdCollapseEnd

    Set NewTable = ActiveDocument.Tables.Add(tblRange, NumRows, NumColumns, etc)

     

    While you would usually set the tolal number of columns when adding the table, in most cases you would not set the total number of rows as you can simply use

     

    NewTable.Rows.Add 

     

    whenever a new row is required.

     The following is a listing of the members of the Table class

     

     

    As an example, this is a screen shot of onw of the tables in an 1100 page document that was created, populated with text and formatted using a visual basic routine run from an Access database

     

     

     

     

     

     

     

     

Resources