#1
|
|||
|
|||
Pasting the same word in front of a paragraph in multiple rows
I got a word document with 30+ rows that contain text, I like to paste or insert a checkbox in front of the text in every row without having to do this line by line. Is there a way to do that? I got close to 100 docs like this, and it is very time consuming to do every line one by one. Thank You very much for any help with this.
|
#2
|
||||
|
||||
What has this to do with Word Tables? You posted in the Word Tables section.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
This has to do with tables because I can't use the ^p replace code as there is none when the text is in a cell.
When I have a normal text line not within a table I can use the replace ^p with the checkbox, however when the text is in a table cell this does not work, as there is no paragraph code in front of the text. Here is a picture of what I like to accomplish https://www.dropbox.com/s/sbcvk5a0v2sw8yv/temp.JPG?dl=0 |
#4
|
||||
|
||||
Is that supposed to be an actual checkbox, or just a square?
Kindly also attach your examples directly to your posts instead of posting links to other sites. You can do this via the paperclip button on the Advanced posting screen.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
It is an actual Checkbox
It is an actual checkbox, have the word template attached. Thanks for your help.
|
#6
|
||||
|
||||
Since it's not apparent whether all your tables have exactly the same structure, the following macro works on the premise that you select the starting cell in whatever table you want to update, then run the macro. The checkbox will be added to all cells below the selected one in that cell's column.
Code:
Sub Demo() Application.ScreenUpdating = False Dim c As Long, i As Long, r As Long With Selection If .Information(wdWithInTable) = False Then Exit Sub c = .Cells(1).ColumnIndex: r = .Cells(1).RowIndex With .Tables(1).Range For i = 1 To .Cells.Count With .Cells(i) If .RowIndex >= r Then If .ColumnIndex = c Then With .Range .InsertBefore " " .Collapse wdCollapseStart .ContentControls.Add wdContentControlCheckBox, .Duplicate End With End If End If End With Next End With End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
Thank You Paul, I will try that It would make things much faster.
|
Tags |
insert at beginning, paste, table cell |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pasting multiple rows in table not working as desired | NDnathan | Word Tables | 1 | 04-22-2019 07:07 PM |
Problems pasting rows between two documents | Kea | Word Tables | 1 | 09-24-2015 12:58 AM |
Keep box drawn in front of Video in FRONT position | a_gunslinger | PowerPoint | 1 | 04-18-2013 07:54 AM |
Losing rows when pasting split cells | Gitley | Word Tables | 1 | 01-15-2013 07:49 AM |
Word 2003 form fields and pasting multiple paragraphs. | mwmoron | Word | 1 | 12-07-2012 11:06 PM |