+ Reply to Thread
Results 1 to 5 of 5

Advanced Filter copy to range. columns rearranged

  1. #1
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Advanced Filter copy to range. columns rearranged

    Hi All

    the code below takes column data and changes the display order via an autofilter criteria

    This worked fine until the dataset increased. The filtering looks for true in a column and passes the "column sorted" data to an output report.

    Can I change this method to Advanced Filter and consider only the visible cells, commit them to array and then change the sort order to output the array

    Please advise if there are better alternatives
    Please Login or Register  to view this content.
    Last edited by nigelog; 02-22-2019 at 01:04 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Consider only filtered (visible) cells in Autofilter region - current method very slow

    Why not just use Autofilter and a SpecialCells instruction? e.g

    Please Login or Register  to view this content.
    You may need to create a variable to work out the column to which you want the filtered stuff to be copied. I've also assumed the CurrentRegion property will pick up just columns A:AU from row 5 down. If not you'l need to make a small modification.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Consider only filtered (visible) cells in Autofilter region - current method very slow

    Hi Richard, its the different order of the columns using the Advanced Filter method that I cant get to grips with. I suppose I could filter in place and then try to sort the columns from an array

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Consider only filtered (visible) cells in Autofilter region - current method very slow

    To use an Advanced Filter where the columns are differently laid out or a subset of columns then create and name a dedicated output range say 'mydataout' that contains just the column labels you need and a named two cell criteria range - say 'crit' that contains your column J label in the first cell and TRUE in the cell below it.

    Then the data filter is

    Please Login or Register  to view this content.
    Then copy the MyDataOut curret region to your Priority sheet

  5. #5
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Consider only filtered (visible) cells in Autofilter region - current method very slow

    Hi Richard, I tried in a test workbook and spot on, many thanks. I might have to hide a row with column labels in source sheet because of layout in headers but should be Ok

    Ill add the test workbook in case it is of use to anyone else searching for this

+ 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] Delete Cells Current Region Dynamic Range
    By MusicMan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-13-2018, 12:51 PM
  2. Filtered dat on visible cells
    By hudson andrew in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-27-2016, 09:11 AM
  3. Select current region except blank cells
    By mgblair in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-02-2015, 09:51 AM
  4. [SOLVED] Copy/Pasting Values from visible cells (using autofilter) to visible cells
    By evakotsi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2012, 07:49 AM
  5. Autofilter - Sum visible cells
    By BVHis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2008, 06:01 PM
  6. Replies: 1
    Last Post: 10-04-2007, 12:04 PM
  7. [SOLVED] Changing visible (filtered) cells
    By Edwin Niemoller in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-09-2005, 04:05 PM

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