+ Reply to Thread
Results 1 to 3 of 3

VBA Copy and Paste with filter

Hybrid View

  1. #1
    Registered User
    Join Date
    05-24-2017
    Location
    Michigan, USA
    MS-Off Ver
    2016
    Posts
    27

    VBA Copy and Paste with filter

    The following code works well except if the table is filtered. any ideas on how to get around that without undoing the filtering?

    Sub Table_Move()
    
        Dim tbl As ListObject
        Dim N As String
        Dim O As String
            
        Call Clear
            
        N = "New"
        O = "Old"
        
        Set tbl = ActiveSheet.ListObjects("Table1")
        
        tbl.ListColumns(N).DataBodyRange.Copy
        tbl.ListColumns(O).DataBodyRange.PasteSpecial xlPasteValues
        
    
    End Sub

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: VBA Copy and Paste with filter

    What is the goal? (1) Copy all from one column to another or (2) copy visible cells (filtered) in one column to another?

    Of course normal copy visible cells and paste, pastes with not invisible rows. This is usually a good thing.

    Attach a short example file if you like.

  3. #3
    Registered User
    Join Date
    05-24-2017
    Location
    Michigan, USA
    MS-Off Ver
    2016
    Posts
    27

    Re: VBA Copy and Paste with filter

    Yes, i just want to copy "old" column to "new" column regardless of filtering. I need the old column to be an exact clone of the new as we are comparing results day by day.

+ 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] Filter Copy and Paste
    By Simon.xlsx in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-02-2014, 12:44 PM
  2. Replies: 2
    Last Post: 10-06-2013, 11:40 PM
  3. [SOLVED] Filter and then Copy & Paste....
    By puuts in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-20-2013, 12:05 PM
  4. Filter,Copy and Paste VBA
    By Rompetelo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-24-2012, 10:57 AM
  5. filter then copy and paste
    By excellentexcel in forum Excel General
    Replies: 1
    Last Post: 05-03-2009, 09:04 AM
  6. [SOLVED] Need macro to filter, create tab on filter and copy/paste
    By Jen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2006, 11:50 AM

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.6.0 RC 1