+ Reply to Thread
Results 1 to 12 of 12

Transposing and insertion of rows into a column

  1. #1
    Registered User
    Join Date
    07-23-2012
    Location
    Salzburg, Austria
    MS-Off Ver
    Excel 2010
    Posts
    8

    Transposing and insertion of rows into a column

    Hi,

    I'm new to this site, which looks like it could be the answer to all my problems! I hope one day soon I'll be able to offer solutions to other people's questions.

    My problem: I'd like to cut all data in a particular row, e.g. row 4, from column B outwards, e.g. B4-D4, transpose it and INSERT it under A4. In the perfect world I'd also like to insert an empty row between each of the transposed cells. I'd like to do this for all rows that contain data in all the columns across the range. In this example, A4-D4, A7-D7, etc.

    I've attached 2 Excel files: the one I'd like to do the text "transposition" on, and another which shows how it should ideally look like.

    If that is particularly awkward to do, I could just as easily supply 4 identical looking Excel files, each with text only in the A-column, the difference being that each Excel would contain text of a different language. The goal would be the same: to create a single Excel that looks like the attached post-transposition file.

    Hope that all makes sense. Many thanks to anyone who can help me with this.

    Jim
    Last edited by thomsonjim; 08-09-2012 at 04:15 AM.

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Transposing and insertion of rows into a column

    You could use this macro:
    Please Login or Register  to view this content.
    Regards,
    Antonio

  3. #3
    Registered User
    Join Date
    07-23-2012
    Location
    Salzburg, Austria
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Transposing and insertion of rows into a column

    Dear Antonio,

    That is nothing short of genius!! I cannot thank you enough for that.

    Will that work regardless of how many columns have text in them (sometimes there are 8 or 10 languages that we need to get into just the one column) or will I have to adjust something in the macro?

    Again, thanks very much!

    Jim

  4. #4
    Registered User
    Join Date
    07-23-2012
    Location
    Salzburg, Austria
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Transposing and insertion of rows into a column

    Dear Antonio,

    The client has altered its requirements, and your wonderful macro would need a small additional function.

    Each time the macro transposes and inserts the row into column A would it be possible to insert the column headers (so the text in row 1) above the corresponding transposed cells? So as an example, B4 is transposed under A4 with a space inbetween (your macro already does this), and then the column header B1 is also copied between A4 and A6 (which contains the texts from the transposed B4), with an empty row above and below it? It would do the same for the transposed cells from C4, D4, etc., always copying down the corresponding column header.

    Does that make any sense? I'll attach a couple of before and after excels files again in a moment.

    Best regards
    Jim

  5. #5
    Registered User
    Join Date
    07-23-2012
    Location
    Salzburg, Austria
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Transposing and insertion of rows into a column


  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Transposing and insertion of rows into a column

    Hi Jim, try it
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-23-2012
    Location
    Salzburg, Austria
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Transposing and insertion of rows into a column

    Hi Nilem,

    Wow, that works pretty well! Many, many thanks! As a final tweak that would absolutely perfect it, is there any way of keeping the formating (i.e. bold) of the column headers when they're copied down?

    Jim

  8. #8
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Transposing and insertion of rows into a column

    try
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    07-23-2012
    Location
    Salzburg, Austria
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Transposing and insertion of rows into a column

    That's absolutely great! Many, many thanks for your help on this one. Greetings to Russia from Salzburg, Austria!

    Jim

    ---------- Post added at 03:03 PM ---------- Previous post was at 03:02 PM ----------

    That's absolutely great! Many, many thanks for your help on this one. Greetings to Russia from Salzburg, Austria!

    Jim

  10. #10
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Transposing and insertion of rows into a column

    @ thomsonjim

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  11. #11
    Registered User
    Join Date
    07-23-2012
    Location
    Salzburg, Austria
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Transposing and insertion of rows into a column

    Thank you, Cutter, for these tips. I couldn't work out how to mark it as solved.

  12. #12
    Registered User
    Join Date
    07-23-2012
    Location
    Salzburg, Austria
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Transposing and insertion of rows into a column

    Hi Nilem,

    I'm getting a "Run-time error 9" when I try to run your macro on the attached Excel doc (which is how the files will generally look before we perform the macro). When I debug it hightlights the following line: k = k + 2: y(k, 1) = x(1, j)

    Any ideas what might be wrong here?

    Jim
    Attached Files Attached Files

+ 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