+ Reply to Thread
Results 1 to 4 of 4

Change order of columns when pasted?

  1. #1
    Registered User
    Join Date
    06-04-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    42

    Question Change order of columns when pasted?

    I have a macro that pulls columns A,C,D,F from sheets"database" and pastes them in A,B,C,D in sheet1 . The problem is, I don't want them pulled and pasted in that order, I want them instead to be in a different order. Is there a way to paste them in a different order?
    I just want to swap the last two columns so that it looks like this: database column A goes to sheet1 colum A, database column C goes to sheet1 column B, database column F goes to sheet 1 column C and database column D goes to sheet 1 columnD

    Here is the macro, it is also located in the worbook under the "runreport" module. THanks in advance everyone!!

    Please Login or Register  to view this content.
    Last edited by cronerd; 09-23-2013 at 06:06 AM.

  2. #2
    Registered User
    Join Date
    01-28-2013
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003, Excel 2007, Excel 2010
    Posts
    50

    Re: Change order of columns when pasted?

    Unless you're copying and pasting the columns separately, then I can't see a way to paste in a different order. (Someone else may know better)
    However, you could just swap the last two columns around after pasting with something like this.
    Please Login or Register  to view this content.
    Please consider the * button if my post helped you

  3. #3
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Change order of columns when pasted?

    I don't think there is a way to change the order of the columns on the copy & paste instruction, but it should not be difficult to "move" the columns around in the target worksheet after the copy & paste has been performed. Just record the cut & paste steps and add the steps to your macro
    If you like my contribution click the star icon!

  4. #4
    Registered User
    Join Date
    06-04-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Change order of columns when pasted?

    sweet I will use just that ! case solved!

+ 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. [SOLVED] VBA to detect change in order number, then add a value to each 1st line of that order
    By Marijke in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2013, 09:19 AM
  2. Change order of Legend without changing the order of the chart
    By Grimace in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 11-22-2012, 11:53 AM
  3. [SOLVED] The order data is pasted is the wrong way around with my macro
    By Imnotgoodwithnames in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-20-2012, 02:00 PM
  4. Replies: 2
    Last Post: 04-04-2006, 08:25 AM
  5. Replies: 0
    Last Post: 05-19-2005, 04:06 AM

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