Word Macro to insert rows to multiple tables
Closed
such
-
May 16, 2011 at 02:44 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - May 24, 2011 at 10:26 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - May 24, 2011 at 10:26 AM
Related:
- Word Macro to insert rows to multiple tables
- How to insert photo in word for resume - Guide
- Insert check mark in word - Guide
- Insert draft watermark in word on all pages - Guide
- Ms word mod apk for pc - Download - Word processors
- How to delete part of a table in word - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
May 24, 2011 at 10:26 AM
May 24, 2011 at 10:26 AM
In word 2007, when I inserted a table and ran your code. this is what I found
the cell that contain "Procedure" also comes up with baggage. There are two extra non printable characters. So the match failed. In my case I had to make this change
the cell that contain "Procedure" also comes up with baggage. There are two extra non printable characters. So the match failed. In my case I had to make this change
Sub copyn()
'macro to copy rows to multiple tables
Dim tTable As Table
Dim TargetText As String
Dim oRow As Row
Dim v As Variant
TargetText = "Procedure"
For Each tTable In ActiveDocument.Tables
For Each oRow In tTable.Rows
v = oRow.Cells(1).Range.Text
v = Replace(v, Chr(13), vbNullString)
v = Replace(v, Chr(7), vbNullString)
If v = TargetText Then Selection.Paste
Next oRow
Next tTable
End Sub