1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Copy columns and paste in rows in Excel

Discussion in 'Business Applications' started by missyeyah, Jul 7, 2012.

Thread Status:
Not open for further replies.
  1. missyeyah

    missyeyah Thread Starter

    Joined:
    Dec 19, 2011
    Messages:
    3
    Hi,

    I need help in Excel copying columns and paste it in rows.

    Ex: I have Columns A and B.
    Column A Column B
    5.78% 4.51%
    23.60% 32.50%
    14.17% 16.41%
    32.12% 54.16%

    Now output should be in one row.

    Row1 5.78% 4.51% 23.60% 32.50% 14.17% 16.41% 32.12% 54.16%
     
  2. Garf13LD

    Garf13LD

    Joined:
    Apr 17, 2012
    Messages:
    455
    sub test()
    dim rng as range
    dim i as long
    dim col as long
    dim nextcol as long
    dim lastrow as long
    lastrow = range("A"&rows.count).end(xlup)
    set rng = range("A2:B"&lastrow)
    col=rng.columns.count
    nextcol =col+1
    for i=2 to lastrow
    range(cells(i,1),cells(i,col)).copy cells(1,nextcol)
    nextcol=nextcol+col
    next
    rng.delete
    end sub
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1059996

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice