Okay, here's some code to get you started (by the way, I think you did a
great job of restating the issue - surprised no on else responded).
I'm going to have you figure out where exactly you want to paste the other
informaton (code below just copies the entire row to the end of the doc).
Due to the uneven table as a result of cell splits/merges, it's safer to
paste the entire row and then manipulate the cells within that pasted row
(assuming, at least, that the rows to be copied are formatted the same).
Dim iRow As Integer, myRange As Range
'The number in parens relates to the protected table's number -
'I suggest you keep it as the first table in the doc
'Setting a range will process only this table
Set myRange = ActiveDocument.Tables(1).Range
'You need to check all of the form fields in the correct range
For Each aField In myRange.FormFields
If aField.Type = wdFieldFormCheckBox Then
'Process only if True and in Column 3
If (aField.CheckBox.Value = True) And _
(myRange.Information(wdStartOfRangeColumnNumber) = 3) Then
'Need the row number too for copying correct table row
iRow = myRange.Information(wdEndOfRangeRowNumber)
'If protection is not passworded, then remove the password lingo
ActiveDocument.Unprotect Password:="myPassword"
myRange.Rows(iRow).Range.Copy
'The following will paste the row at the end of the current doc
Selection.EndKey Unit:=wdStory
Selection.PasteAndFormat (wdPasteDefault)
'put code here to manipulate pasted row to hold only needed info.
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End If
End If
Next aField
> I have a table which contains rows with different formats (some with merged
> cells, some with split cells). It contains cells with form fields and cells
[quoted text clipped - 18 lines]
> (*create the table when you run into the first instance of cell 3
> checkbox=true)
VBA Neophyte - 06 Aug 2007 20:56 GMT
zkid, thanks very much for the code, I understand a lot better how to
approach this. I'm also changing the design somewhat to make it more
standardized.
> Okay, here's some code to get you started (by the way, I think you did a
> great job of restating the issue - surprised no on else responded).
[quoted text clipped - 57 lines]
> > (*create the table when you run into the first instance of cell 3
> > checkbox=true)
zkid - 06 Aug 2007 23:16 GMT
You're most welcome. I hope it helps. I'll be gone for three weeks without
internet access, so I'll be unavailable for awhile. Good luck to you.
> zkid, thanks very much for the code, I understand a lot better how to
> approach this. I'm also changing the design somewhat to make it more
[quoted text clipped - 61 lines]
> > > (*create the table when you run into the first instance of cell 3
> > > checkbox=true)