+ Reply to Thread
Results 1 to 2 of 2

Macro to transpose rows to columns and copy to Word

  1. #1
    Registered User
    Join Date
    05-28-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    1

    Macro to transpose rows to columns and copy to Word

    Hey, I created a macro to try and transpose rows to columns and copy the transposed data to Word. The data in the excel sheet is of variable length, characters and numbers. What happens though is after a random point the data being copied to Word does not transpose properly. Also, due to the Autofit Cell size in Excel, the formatting gets all twisted in Word, I think.

    I have attached the Sample data, the result that I get from my Macro, and the required data.

    The column headings need to be on every page. and the data columns should be incremented on every page too such that each new page in Word has the column headings in Bold as seen, and the next data columns transposed in that format. I am not good in programming so I dunno what conditions do I have to use to keep headings constant only data columns incremented. Also, is it me going wrong resulting in latter pages not being transformed, or is it some issue with Excel/Word itself due to the cell size.

    Can you point out the mistakes in my code? I certainly need to learn where I went wrong so I can fix it.
    PortMacro.txt

    Required.docx

    Result.docx

    Sample.xlsx
    Last edited by usb501; 05-28-2013 at 02:58 AM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Macro to transpose rows to columns and copy to Word

    I think you have to attach a simpler example to understand better the transposing only in excel with current and desired data.
    If solved remember to mark Thread as solved

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1