VBA Word Create Table

VBA to create word document with a table.   Define number of rows and number of columns in the intNoOfRows and intNoOfColumns variables.

Enable Microsoft Word 16.0 Object Library

Dim wrdDoc As Word.Document
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Add
With wrdDoc
   Dim intNoOfRow, intNoOfColumns As Long
   Set objRange = wrdDoc.Content
   objRange.Collapse Direction:=wdCollapseEnd
   intNoOfRows = 2
   intNoOfColumns = 2
   wrdDoc.Tables.Add objRange, intNoOfRows, intNoOfColumns

   Set objTable = wrdDoc.Tables(1)
   objTable.Borders.Enable = True
   objTable.Cell(1, 1).Range.Text = "Change Related To"
   objTable.Cell(1, 1).Range.Bold = True
   objTable.Cell(1, 2).Range.Text = "Change Description"
   objTable.Cell(1, 2).Range.Bold = True
   objTable.Cell(2, 1).Range.Text = "xxx"
   objTable.Cell(2, 2).Range.Text = "yyy"
   objTable.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
End With
[efb_likebox fanpage_url="https://www.facebook.com/vbamarket/" box_width="840" box_height=340"" responsive="1" show_faces="1" show_stream="1" hide_cover="1" small_header="0" hide_cta="0" locale="en_US"]