+ Reply to Thread
Results 1 to 3 of 3

Thread: Copying Columns Across Worksheets

  1. #1
    Registered User
    Join Date
    12-29-2008
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    2

    Copying Columns Across Worksheets

    I have a large amount of data in two different worksheets, worksheet 1 and worksheet 2. I am trying to copy all the info from one worksheet to the next, but in a different order.

    ie. columns A,B,C in worksheet 1 should be copied into columns B,A,D of worksheet 2.

    How can I create a new worksheet and copy certain columns in a given order? The only way I know is to copy it column by column but this takes a very long time.

    Thanks!

    Yoav

  2. #2
    Forum Contributor beeawwb's Avatar
    Join Date
    01-04-2004
    Location
    Perth, WA, Australia
    MS-Off Ver
    Microsoft Office Excel 2003 (11.8146.8221) SP2
    Posts
    105
    Hi there, the following code should work if I'm understanding the problem correctly.

    Sheets("Sheet2").Range("B:B").Value = Sheets("Sheet1").Range("A:A").Value
    Sheets("Sheet2").Range("A:A").Value = Sheets("Sheet1").Range("B:B").Value
    Sheets("Sheet2").Range("D:D").Value = Sheets("Sheet1").Range("C:C").Value

  3. #3
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,777
    If you want to copy formulas and formatting as well,
    With Worksheets("Sheet1")
        .Columns(1).Copy Destination:=Worksheets("Sheet2").Range("B1")
        .Columns(2).Copy Destination:=Worksheets("Sheet2").Range("A1")
        .Columns(3).Copy Destination:=Worksheets("Sheet2").Range("D1")
     End With
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0