View Single Post
 
Old 12-11-2017, 01:26 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,138
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

As your form already contains code to add a row, then delete all the rows except the first to begin with and only add the rows as you require them, however to address your question the following will delete the row the cursor is in.

Code:
Sub DeleteTableRow()
Dim oCC As ContentControl
    If Selection.Information(wdWithInTable) = True Then
        For Each oCC In Selection.Rows(1).Range.ContentControls
            oCC.LockContentControl = False
            oCC.Delete
        Next oCC
        Selection.Rows(1).Delete
    Else
        MsgBox "Selection is not in a table!"
    End If
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote