This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Dim docNew As Document Dim tableNew As Table Dim rangeCell As Range Set docNew = Documents.Add Set tableNew = docNew.Tables.Add(Selection.Range, 3, 5) Set rangeCell = tableNew.Cell(3,5).Range rangeCell.InsertAfter "Cell(3,5)" docNew.Bookmarks.Add Name:="BKMK_Cell35", Range:=rangeCell MsgBox docNew.Bookmarks(1).Column
As it applies to the Cell object. This example creates a 3x5 table and applies shading to the even-numbered columns. Dim tableNew As Table Dim cellLoop As Cell Selection.Collapse Direction:=wdCollapseStart Set tableNew = _ ActiveDocument.Tables.Add(Range:=Selection.Range, _ NumRows:=3, NumColumns:=5) For Each cellLoop In tableNew.Rows(1).Cells If cellLoop.ColumnIndex Mod 2 = 0 Then cellLoop.Column.Shading.Texture = wdTexture10Percent End If Next cellLoop