![]() |
#4
|
||||
|
||||
![]()
That's just a matter of transposing the process:
Code:
Sub Demo() Application.ScreenUpdating = False Dim Rng As Range, r As Long, c As Long With ActiveDocument.Tables(1) If .Columns.Count * .Rows.Count > 63 Then MsgBox "Too many cells - 63 is the maximum supported", vbCritical Exit Sub End If For c = .Columns.Count To 1 Step -1 For r = .Rows.Count To 2 Step -1 If c = .Columns.Count Then .Columns.Add Else .Columns.Add .Columns(c + 1) End If Set Rng = .Cell(r, c).Range Rng.End = Rng.End - 1 .Cell(1, c + 1).Range.FormattedText = Rng.FormattedText Next Next For r = .Rows.Count To 2 Step -1 .Rows(r).Delete Next End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
error message, pasteandformat table |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word Error Message Run time Error 4605 | baes10 | Word VBA | 1 | 08-30-2018 02:37 PM |
Error Message | PointCheck | Word VBA | 1 | 08-13-2018 02:42 PM |
No known fix for this error message... | Aymincendiary | PowerPoint | 1 | 09-03-2017 05:38 PM |
![]() |
ktest | Office | 1 | 02-12-2016 08:08 PM |
![]() |
hlina | Excel | 1 | 10-08-2013 09:14 PM |