+ Reply to Thread
Results 1 to 4 of 4

How to generate one long column from a series of rows?

  1. #1
    Registered User
    Join Date
    06-26-2007
    Posts
    2

    Question How to generate one long column from a series of rows?

    Hi,

    I am trying to reaccustom myself to Excel, after not having used it for a couple of years. So bear over with me if this is a silly question.

    I have a set of data (or several actually) where each row is a year and each column is a month. I.e., I have monthly data for a variable in a 20x12 format when there is 20 years. I want to plot these as one continuous line (a line graph).

    One way of doing this is of course to copy each line, paste them into one long line, and then copy and paste the transpose of this. But this gets cumbersome.

    Is there an easier way?

    I tried recording a macro, but couldn't figure out how to make the script general (I am a fairly adept programmer, but haven't gotten a hold of VBA yet. Not sure if it's worth it.).

    I hope somebody can help.

  2. #2
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562
    Humbro,

    You could try something like this
    Please Login or Register  to view this content.
    This code will take the information on Sheet1 and put it into a single column on Sheet2. It looks at the number of rows and the number of columns used in each row.

    Hope this helps!
    Sincerely,
    Jeff

  3. #3
    Registered User
    Join Date
    06-26-2007
    Posts
    2
    Thanks a million!

  4. #4
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562
    Humbro,

    I forgot one thing. If you would, add this code right before the End Sub
    Please Login or Register  to view this content.
    It is always good to clear the variables and release the memory.

+ 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