+ Reply to Thread
Results 1 to 5 of 5

Problem when copy filtered table in Excel 2007 using VBA

  1. #1
    Registered User
    Join Date
    03-11-2013
    Location
    colombia
    MS-Off Ver
    Excel 2007
    Posts
    18

    Problem when copy filtered table in Excel 2007 using VBA

    Hello Guys, I am trying to copy and paste a filtered table (named table1) which is in the sheet DATA through a macro, but , when I execute the macro, there are rows that aren't copy.

    I copy the filtered table using the VBA code:
    Please Login or Register  to view this content.
    An example workbook is attached.

    Someone can help me, please, any help is welcome, thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Problem when copy filtered table in Excel 2007 using VBA

    You missed out the criteria for filter in your code

  3. #3
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Problem when copy filtered table in Excel 2007 using VBA

    try
    Please Login or Register  to view this content.
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  4. #4
    Registered User
    Join Date
    03-11-2013
    Location
    colombia
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Problem when copy filtered table in Excel 2007 using VBA

    I discover my problem,this is, the table "table1" is filtered , so, there is rows that are hidden, when I copy and paste the filtered rows in the right side of my filtered table , the hidden rows stay hidden , so , I can't see someone rows that I copy from the original filtered table.The solution is remove the filter to the filtered table with the code : ListObjects("table1").Range.AutoFilter. Thanks tehneXus.

  5. #5
    Registered User
    Join Date
    12-03-2012
    Location
    Greenville, SC
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Problem when copy filtered table in Excel 2007 using VBA

    This worked for me. Only the filtered (and thus, visible) rows are copied. The data was filtered with another macro. Hopefully it will helpful to others.

    Please Login or Register  to view this content.

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