Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
This is sort of what you asked for... (but I would do it Jonathan's
way if it were me.) Instead of a Checkbox, which would require the document to be protected, this routine uses a cell in column 1. So, add a column and place a check (the letter X) in the row you want to include in the second document. Sub SelectCheck() Dim aDoc As Document Dim aDoc2 As Document Dim aTable As Table Dim MyRange As Range Dim MyCell As Range Dim NumRows As Integer Dim A As Integer Set aDoc = ActiveDocument Set aTable = aDoc.Tables(1) 'Adjust to your table number Set aDoc2 = Documents.Add NumRows = aTable.Rows.Count For A = 1 To NumRows With aTable 'Get the contents of the first cell and see if there's a check Set MyCell = .Cell(A, 1).Range 'Strip off the end of cell marker MyCell.MoveEnd wdCharacter, -1 'If check found then paste it in the new Doc. If MyCell = UCase("X") Then .Rows(A).Range.Copy Set MyRange = aDoc2.Range _ (Start:=aDoc2.Content.End - 1, _ End:=aDoc2.Content.End - 1) MyRange.Paste 'Clears the Check MyCell.Text = "" End If End With Next A End Sub Hope this helps. David |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I highlight & copy just select parts of an email? | Microsoft Word Help | |||
Select all, copy and paste doesn't copy the header | Microsoft Word Help | |||
User Unable to Select Checkbox | Microsoft Word Help | |||
How do you select a checkbox with a keystroke instead of a mouse? | Microsoft Word Help | |||
Select only one checkbox from a list in a form | Microsoft Word Help |