View Single Post
 
Old 09-05-2022, 03:15 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Since it's not apparent whether all your tables have exactly the same structure, the following macro works on the premise that you select the starting cell in whatever table you want to update, then run the macro. The checkbox will be added to all cells below the selected one in that cell's column.
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim c As Long, i As Long, r As Long
With Selection
  If .Information(wdWithInTable) = False Then Exit Sub
  c = .Cells(1).ColumnIndex: r = .Cells(1).RowIndex
  With .Tables(1).Range
    For i = 1 To .Cells.Count
      With .Cells(i)
        If .RowIndex >= r Then
          If .ColumnIndex = c Then
            With .Range
              .InsertBefore " "
              .Collapse wdCollapseStart
              .ContentControls.Add wdContentControlCheckBox, .Duplicate
            End With
          End If
        End If
      End With
    Next
  End With
End With
Application.ScreenUpdating = True
End Sub
In your attachment, the table has a narrow row at the bottom. As coded, the macro adds a checkbox there, too, which you can delete afterwards. Again, the macro is coded this way because it's not apparent whether all your tables have exactly the same structure.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote