+ Reply to Thread
Results 1 to 4 of 4

Paste array to sheet with filter applied

  1. #1
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Office 365 MSO (16.0.10730.20264) 32-bit
    Posts
    160

    Paste array to sheet with filter applied

    Hi all.

    I wrote a udf to rank based on filtering... if visible, I consider it, if hidden, I note it. I bubble sort high to low, fill an array with rank 1 to count .... then I re-sort rank array based on original order. All done with arrays. I need to paste the rank back to the sheet - remember the sheet is filtered.

    I initiate the rank sub based on a value on the sheet changes - on calculate... and I also initiate the rank sub based on a subtotal calculate event on the sheet to capture when the filter is changed. All works well.. BUT!

    It seems that when I paste the rank back to the filtered sheet, it does not paste.. something to do with the filtering. If I loop thru the array, it works, but slowly..
    Does not work properly... well, works if the filter is set to show the 1st row in the range
    Please Login or Register  to view this content.
    This works, but way to slowly...
    Please Login or Register  to view this content.
    Thanks for the help....
    Steve
    Harrisburg, PA

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: Paste array to sheet with filter applied

    It'd be a lot easier for us to help you, if you upload sample workbook with current code.

    Without it, we would be guessing as to how your code can be optimized.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Office 365 MSO (16.0.10730.20264) 32-bit
    Posts
    160

    Re: Paste array to sheet with filter applied

    Hi.. File attached.

    Set filter based on "Product Series" and recalculate Rank of visible rows
    Please Login or Register  to view this content.
    File attached...
    Attached Files Attached Files

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: Paste array to sheet with filter applied

    Hmm, your 2nd code does run pretty quickly on my end.

    Entire process runs in about .1 sec.

    In your actual workbook, is there way more items and/or calculations that's slowing things down?

    Alternately, you could store filter condition. Remove filter, load data back on sheet, then apply the filter again.

+ 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 Array 1 with Array 2 as criteria, returning filtered data to source sheet
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-31-2019, 01:08 PM
  2. application of filter option on all sheets once applied on first main sheet
    By watermasa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-21-2015, 09:23 AM
  3. Replies: 0
    Last Post: 10-10-2014, 02:02 PM
  4. [SOLVED] Count Unique function in sheet with data filter applied
    By TedH in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-28-2013, 11:39 PM
  5. [SOLVED] Need: filter, paste info to new sheet, rename sheet, unfilter, hide column, filter next
    By esmithqg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2012, 04:49 PM
  6. Replies: 5
    Last Post: 05-23-2012, 10:33 AM
  7. Filter sheet then assign values into array based on this filtered sheet
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-06-2011, 10:32 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