+ Reply to Thread
Results 1 to 2 of 2

Autofilter loop + copy paste?

  1. #1
    Registered User
    Join Date
    07-04-2017
    Location
    Belgium
    MS-Off Ver
    365 ProPlus
    Posts
    81

    Autofilter loop + copy paste?

    Hey all,

    I managed to write a working piece of code (see post 2), but it's quite amateurish.
    Does anyone feel like reviewing my code or make it a lot more simple?

    What the marcro does (see attachment):

    1) Write down the name of the company (test value: A, B, C, D, E or F)
    2) It sets 4 different filters and copy pastes each filtered result, but only if the filtered result > 0.
    3) The position of the copy-pasted part is dynamic.

    If the first filter has a result, the result should be copied to last row +2 (below the text) and if the second filter has a result, the result should be copied to a new lastrow +3 (thus below the first result).

    If the first filter has no result it should not be copied and if the second filter has a result it should be copied to last row +2 (below the text) and the third filter should be copied to a new last row + 3 ( thus below the second result).

    The different values show you what I mean.
    Attached Files Attached Files
    Last edited by dunnobe; 02-11-2019 at 05:06 AM.

  2. #2
    Registered User
    Join Date
    07-04-2017
    Location
    Belgium
    MS-Off Ver
    365 ProPlus
    Posts
    81

    Re: Multiple filters + dynamic pasting of the result -> code review or simplification want

    Small bump as I simplified the code a little bit.

    Does anyone have more ideas on how to shorten the code and still have the same result?
    Is there some loop possible for the KPI1-2-3 part? It's exacly the same except for the .autofilter field:=19, Criteria1:= part

    Thanks

    Please Login or Register  to view this content.
    Last edited by dunnobe; 02-11-2019 at 04:25 AM.

+ 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. If function problem ... not the wanted result
    By mat1995 in forum Excel General
    Replies: 5
    Last Post: 09-25-2017, 07:43 AM
  2. Pasting a dynamic formula into multiple cells
    By Tonan230 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-18-2016, 05:27 PM
  3. Dynamic filters using multiple criteria
    By dcr8r4life in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-10-2015, 10:59 AM
  4. Auto pasting when it's not wanted.
    By Duskins in forum Excel General
    Replies: 1
    Last Post: 06-22-2015, 12:32 AM
  5. Dynamic filters (different strings) for multiple sheets in the same workbook
    By wildradical in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-03-2014, 08:30 AM
  6. The right Formula to get result wanted
    By kaseyleigh in forum Excel General
    Replies: 1
    Last Post: 10-29-2009, 06:14 AM
  7. Simplification of macro code
    By PvanS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2009, 10:42 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