Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 02-17-2021, 12:08 AM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Need help, get error message when place tbl.... Windows 10 Need help, get error message when place tbl.... Office 2019
Competent Performer
Need help, get error message when place tbl....
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 200
Cendrinne is on a distinguished road
Default

If this is what I was supposed to do, it made it worst:
It transposed a column for every text rows. Hikes

Code:
Sub T1fr_Merge_3Col_Vert_en_1_sous_TST_BETTER2()

'From Forum, created by macropod Paul Edstein 2021-02-17
Application.ScreenUpdating = False
Dim Rng As range, r As Long, c As Long
With ActiveDocument.Tables(1)
  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
      .AutoFitBehavior wdAutoFitWindow
      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
First, it gave me another error message:
Execution error 5941
The required Collection member does not exist.
(again, my system is in French, and I'm translating it).

I've done it again, to copy the script error message, now it gave me another error code:
4198, the Command failed

Then under Debug: it went to line: cColumns.Add .Columns(c + 1)

I'm beyond tired now. Going to bed, but it was nice catching up with you

Thanks for trying.

until next time,

Cendrinne
Reply With Quote
 

Tags
error message, pasteandformat table



Similar Threads
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
Need help, get error message when place tbl.... Reserved error(-1517); there is no message for this error ktest Office 1 02-12-2016 08:08 PM
Need help, get error message when place tbl.... Automation error Unknown error" message once they open the Excel file hlina Excel 1 10-08-2013 09:14 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:40 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