View Single Post
  #6   Report Post  
Posted to microsoft.public.word.tables
Greg
 
Posts: n/a
Default Form rows with CheckBoxes

Gus,

As Jezebel has suggested. Why don't you just delete the rows instead
of trying to squish them up.

Try:
Sub DeleteUnChecked()
Dim pRowIndex As Long
Dim pRows As Word.Rows
Application.ScreenUpdating = False
If ActiveDocument.ProtectionType wdNoProtection Then
ActiveDocument.Unprotect
End If
Set pRows = ActiveDocument.Tables(1).Rows
For pRowIndex = pRows.Count To 1 Step -1
If pRows(pRowIndex).Range.FormFields(1).CheckBox.Valu e = False Then
pRows(pRowIndex).Delete
End If
Next
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub