![]() |
#1
|
|||
|
|||
![]()
I try to combine the texts of all cells in a column into a paragraph.
For example: Table is like : 1 this 2 is 3 great I would like to get "this is great". But my code below always return " this is great" Could you please help me out. Many thanks. Code:
Sub TEST1() Dim c As Long Dim String1 As String With ActiveDocument.Tables(1) For r = 1 To .Rows.Count String1 = String1 & .Cell(r, .Columns.Count).Range.Text 'Debug.Print String1 Next r End With With ActiveDocument.SelectContentControlsByTitle("text1")(1) '.LockContentControl = False .Range.Text = String1 '.LockContentControl = True End With End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
NicB | Word Tables | 2 | 02-20-2019 03:05 AM |
![]() |
vjvj123 | Excel Programming | 6 | 09-26-2018 09:19 AM |
![]() |
eborda | Word | 1 | 03-24-2017 11:06 PM |
Interchange line break and paragraph break shortcut keys | skan | Word | 2 | 01-20-2017 03:50 AM |
How to automatically insert a line after a Column Break | YooperNC | Word | 3 | 01-29-2015 07:16 AM |