![]() |
|
![]() |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
I have here a skin form i use to track wounds. I have now a macro to create a new row when needed. I need help creating a check box or a button next two each row to enable deletion of the entire row. Could you help? Thanks!
|
#2
|
||||
|
||||
![]()
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 |
#3
|
|||
|
|||
![]() Quote:
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to get control/option-delete to only delete the word and not the preceding space | microsofthelp | Word | 0 | 11-20-2016 04:34 AM |
![]() |
copleyr | PowerPoint | 1 | 10-07-2016 01:15 AM |
![]() |
zeroth | Word | 3 | 11-08-2012 08:57 AM |
![]() |
dpb001 | Word VBA | 1 | 05-02-2012 12:41 AM |
issue in nested user control | selva | Misc | 1 | 10-20-2011 10:18 PM |