+ Reply to Thread
Results 1 to 2 of 2

copy and paste columns in a specific order on a different excel sheet.

  1. #1
    Registered User
    Join Date
    05-07-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    2

    copy and paste columns in a specific order on a different excel sheet.

    Hi all,

    The problem im facing is once i apply a marco to filter out all the irrelevant columns, I need to paste the columns left over to a different spreadsheet. As the data which is filtered comes from another database with many users, the order of the columns will change. Im hoping to add on this process to the macro which filters the data. I’ve pasted the macro im using to filter below.

    Sub DelColumnNotInList()
    Dim LastCol As Double
    Dim ColCtr As Double
    LastCol = Cells(1, Columns.Count).End(xlToLeft).Column
    For ColCtr = 1 To LastCol
    If InStr("Trade Id Trade Date Start Date End Date Deal Price Counterparty Buy Sell Total Energy Total Cost", Cells(1, ColCtr).Text) = 0 Then
    Cells(1, ColCtr).EntireColumn.Delete
    ColCtr = ColCtr - 1
    End If
    Next ColCtr
    End Sub

  2. #2
    Forum Contributor
    Join Date
    10-19-2012
    Location
    Omaha, Nebraska USA
    MS-Off Ver
    Excel 2010
    Posts
    249

    Re: copy and paste columns in a specific order on a different excel sheet.

    Hey milkfloat,

    If you are just looking to tranfer the data from one sheet to another after you have deleted specific information, try adding this to the end of your code:

    Please Login or Register  to view this content.
    Thanks,

    Daniel

+ 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