Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
David Sisson David Sisson is offline
external usenet poster
 
Location: Deep southern US
Posts: 3
Default Select row with checkbox and copy to other doc!

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I highlight & copy just select parts of an email? Janie Microsoft Word Help 2 February 14th 07 06:27 AM
Select all, copy and paste doesn't copy the header Jmill Microsoft Word Help 3 January 18th 07 10:32 PM
User Unable to Select Checkbox [email protected] Microsoft Word Help 4 May 5th 06 04:21 AM
How do you select a checkbox with a keystroke instead of a mouse? JeffTodd Microsoft Word Help 2 March 26th 05 09:19 PM
Select only one checkbox from a list in a form JanetH Microsoft Word Help 1 February 23rd 05 02:19 AM


All times are GMT +1. The time now is 06:08 AM.

Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"