+ Reply to Thread
Results 1 to 7 of 7

Macro to copy data from a row (consist of multiple columns) into to single column

  1. #1
    Registered User
    Join Date
    10-05-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    57

    Question Macro to copy data from a row (consist of multiple columns) into to single column

    Hi,

    I am trying to write a macro that select "Sheet 1" and copy certain data from single row (consist of multiple columns) and paste in single column (with stacked rows) in "sheet 2". It definitely sounds like simple transpose but its lot more complicated than simple transpose. I have attached an example excel sheet to my post. In the sheet I just showed a range from A:Y but actual data range is much longer and unknown. Therefore, macro should identify the range and copy into a single column. Any help is greatly appreciated.

    Thanks
    Aroni


    Book1.xlsx

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro to copy data from a row (consist of multiple columns) into to single column

    You have merged cells. VBA and Merged cells are not good friends. It is difficult to loop through merged cells.

  3. #3
    Registered User
    Join Date
    10-05-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    57

    Re: Macro to copy data from a row (consist of multiple columns) into to single column

    Unfortunately, I get this sheet from another person. However, I can add a line to unmerge cells in the VBAcode.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro to copy data from a row (consist of multiple columns) into to single column

    I have unmerged the cells and some of the cells end up in different columns.
    The code works on the sample.
    I have used current region to define my range for efficiency reason. It works fine you can extend your column up to last column ,so long as there is no complete blank row or column.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-05-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    57

    Re: Macro to copy data from a row (consist of multiple columns) into to single column

    Thank you very much. You really saved me a lot of time. Now I have a start, I can add additional information to your macro. Thanks again and greatly appreciate your help

  6. #6
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Macro to copy data from a row (consist of multiple columns) into to single column

    AB33 was right. Anyway, here's the code from my side

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-05-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    57

    Re: Macro to copy data from a row (consist of multiple columns) into to single column

    Thanks JieJenn.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 05-25-2013, 07:12 AM
  2. [SOLVED] need help to copy paste the data from multiple columns into single row.
    By apowale in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-06-2013, 06:29 AM
  3. single data column into multiple columns
    By ifsmithy in forum Excel General
    Replies: 5
    Last Post: 02-08-2012, 12:38 AM
  4. Replies: 5
    Last Post: 02-07-2012, 04:55 PM
  5. [SOLVED] merge data from multiple columns to single column
    By triggerthehorse in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2005, 04:06 PM

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