Home
FREE DOWNLOADS
VBA Tutorials
VBA Code Samples
VBA Code - Excel
VBA for Beginners
Save Time on PC
SaveTimeWebsite
Save Time News
Save Time Blog
SaveTime SiteMap
Customer Service
Gibberish

Subscribe To
This Site

XML RSS
Add to Google
Add to My Yahoo!
Add to My MSN
Add to Newsgator
Subscribe with Bloglines

Microsoft Word VBA Tables Column and Row Manipulation

Microsoft Word VBA Tables column and row manipulation is easiest when using a recorded macro as your starting point.

The following recorded macro inserts or adds a default table of 2 rows and 5 colums. then it inserts a row and then deletes the row.

Once again, the easiest way to work with a table is to record a macro as your basis, and then adjust the code from there...

Go to the Tools menu > Macros and choose Record New Macro.

Insert a table, add rows/columns, format the columns/rows and the text or what ever you need to accomplish.

    Documents.Add DocumentType:=wdNewBlankDocument
    ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=2, _
    NumColumns:= 5, DefaultTableBehavior:=wdWord9TableBehavior, _
    AutoFitBehavior:= wdAutoFitFixed
    With Selection.Tables(1)
        If .Style <> "Table Grid" Then
            .Style = "Table Grid"
        End If
        .ApplyStyleHeadingRows = True
        .ApplyStyleLastRow = True
        .ApplyStyleFirstColumn = True
        .ApplyStyleLastColumn = True
    End With
    Selection.InsertRowsBelow 1
    Selection.Rows.Delete
Google

Return from Microsoft Word VBA Tables Column to VBA Code Samples

Return to our Home page



footer for microsoft word vba tables column page