![]() |
|
#2
|
||||
|
||||
|
It appears that in a regular table (where all columns align exactly) this code would have just filled one column. But if at least one row has different column width/alignment (or maybe there are merged cells) then more than one column gets the inserted text.
Can you verify that all the table cells are aligned perfectly? PS. I would deal with the selection error a different way. Code:
Sub aTest()
Dim Lstr As String, aCell As Cell
If Selection.Information(wdWithInTable) Then
Selection.InsertColumns
Lstr = Me.txtColLeftText
For Each aCell In Selection.Cells
aCell.Range.Text = Lstr
Next aCell
Selection.MoveRight Unit:=wdCell
End If
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Want to Insert Column and add text into entire column.
|
Steve Kunkel | Word VBA | 2 | 04-14-2021 07:22 PM |
| not able to insert a column | Zumba | Excel | 1 | 10-06-2017 11:27 PM |
Insert Table To Multi Column Page
|
mertdogan | Word Tables | 2 | 08-03-2017 03:46 PM |
| How to automatically insert a line after a Column Break | YooperNC | Word | 3 | 01-29-2015 07:16 AM |
How to insert ne wline within a column
|
kesh | Excel | 2 | 12-09-2011 09:38 AM |