+ Reply to Thread
Results 1 to 13 of 13

Macros for Moving Data from Columns to Rows

  1. #1
    Registered User
    Join Date
    05-31-2013
    Location
    DC
    MS-Off Ver
    Excel 2007
    Posts
    14

    Macros for Moving Data from Columns to Rows

    I am new to this forum and would greatly appreciate any help in writing macro for moving data from columns to rows.

    example of original data is in "Source" worksheet and desired output is in "Destination" worksheet of the attached example.

    Thanks

    Ravi
    Attached Files Attached Files

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

    Re: Macros for Moving Data from Columns to Rows

    Output in new sheet
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-31-2013
    Location
    DC
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Macros for Moving Data from Columns to Rows

    Thanks, AB33

    You are awesome and a STAR

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

    Re: Macros for Moving Data from Columns to Rows

    Rajnish,
    Thanks for kind words and you are welcome!

  5. #5
    Registered User
    Join Date
    05-31-2013
    Location
    DC
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Macros for Moving Data from Columns to Rows

    May I know how to maintain column properties while running macro - column is changing from "text" to "general" and zeros before whole numbers are getting lost

    Thanks

    Ravi

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

    Re: Macros for Moving Data from Columns to Rows

    You can add these two lines below
    Please Login or Register  to view this content.
    Despite the formatting has changed to text and shows text on the formatting, it omits zeros.

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-31-2013
    Location
    DC
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Macros for Moving Data from Columns to Rows

    Columns 1 and 4 are still returning data omitting zeros. I tried changed "NumberFormat" to "TextFormat" without success.

    Thanks

    Ravi

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

    Re: Macros for Moving Data from Columns to Rows

    Ravi,
    Column 1 is a text. Yes, there is an issue with column 4, but you can change column 6 in to what ever format you want (Number with two digit, or time format). You can copy the formatting from excel and put it on the ""
    I am trying to get around with column 4.

  9. #9
    Registered User
    Join Date
    05-31-2013
    Location
    DC
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Macros for Moving Data from Columns to Rows

    Thanks, AB33

    I think we can live with the format as it is - you have been a big help and your solution will go a long way

    Bests

    Ravi

  10. #10
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Macros for Moving Data from Columns to Rows

    Hello rrajnish and AB33,

    I am trying to get around with column 4.
    Try the attached WorkBook.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

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

    Re: Macros for Moving Data from Columns to Rows

    Winon,
    Well done and thanks!
    I had struggled with changing the formatting and you did the trick.

  12. #12
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Macros for Moving Data from Columns to Rows

    @ AB33,

    Well, in your "PM" you have asked for help, and I am only too happy to do so.

    Glad you are happy with the result!

    Let's hope Ravi also likes it...

  13. #13
    Registered User
    Join Date
    05-31-2013
    Location
    DC
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Macros for Moving Data from Columns to Rows

    Thanks, AB33 and WINON

+ 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