Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 09-05-2022, 03:15 PM
macropod's Avatar
macropod macropod is offline Pasting the same word in front of a paragraph in multiple rows Windows 10 Pasting the same word in front of a paragraph in multiple rows Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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
In your attachment, the table has a narrow row at the bottom. As coded, the macro adds a checkbox there, too, which you can delete afterwards. Again, the macro is coded this way because it's not apparent whether all your tables have exactly the same structure.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
insert at beginning, paste, table cell



Similar Threads
Thread Thread Starter Forum Replies Last Post
Pasting the same word in front of a paragraph in multiple rows Pasting multiple rows in table not working as desired NDnathan Word Tables 1 04-22-2019 07:07 PM
Pasting the same word in front of a paragraph in multiple rows Problems pasting rows between two documents Kea Word Tables 1 09-24-2015 12:58 AM
Pasting the same word in front of a paragraph in multiple rows 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

Other Forums: Access Forums

All times are GMT -7. The time now is 05:13 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft