![]() |
#17
|
||||
|
||||
![]()
The macro to which you refer requires all formfields on a row to be empty before a deletion will occur. Your document, however, always has content in the formfields in columns 3-5. Hence no row will ever be deleted. Since your 'controlling' field appears to be the first one on each row, you might try:
Code:
Sub DeleteEmptyRows() 'Delete empty rows in the table Application.ScreenUpdating = False Dim StrPwd As String, i As Long StrPwd = "" With ActiveDocument If .ProtectionType = wdAllowOnlyFormFields Then .Unprotect Password:=StrPwd With .Tables(1) For i = .Rows.Count - 1 To 2 Step -1 With .Rows(i) If Trim(.Range.FormFields(1).Result) = "" Then .Delete End With Next End With .Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=StrPwd End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
delete row, form fields, protected form |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
simville02 | Word Tables | 1 | 01-31-2013 11:12 PM |
Using macro to add variable number of rows to a protected word table | Julia | Word Tables | 1 | 01-09-2013 06:04 AM |
![]() |
elky1967 | Word VBA | 14 | 09-21-2012 05:27 AM |
Adding table lines to protected form | razberri | Word Tables | 2 | 10-27-2010 05:58 PM |
Editing Password protected form fields in Word 2007 | tamilan | Word | 2 | 02-16-2010 09:45 AM |