+ Reply to Thread
Results 1 to 9 of 9

Copy Filtered data and stop macro when filter is empty

  1. #1
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    260

    Copy Filtered data and stop macro when filter is empty

    Hi all :-)

    I was wondering, if here is anybody, who could help me with following code.

    ==> I have a code to filter columns based on criteria which should be copy pasted to other sheet. If there are any results, no problem. But I'm not able to modify macro, that if filter is empty, that in the end I do not have any results, which code to use to stop it?

    Thanks,
    Andy

  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: Copy Filtered data and stop macro when filter is empty

    If the SpecialCells visible rows range's Rows.count =1 then exit. That is if you include the title row...

  3. #3
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    260

    Re: Copy Filtered data and stop macro when filter is empty

    Can you just help me how to write line for visible cells >=1 ?
    I'm done today :-(

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Copy Filtered data and stop macro when filter is empty

    Hi dobracik

    Post the Code your using...one of us will modify for you.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

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

    Re: Copy Filtered data and stop macro when filter is empty

    Since you did not post code, the only way I might be able to help is to guess:
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    260

    Re: Copy Filtered data and stop macro when filter is empty

    Hi both :-)
    will try to use Kenneth code, but just in case here I'm sending mine.

    Please Login or Register  to view this content.

    So if filter is empty, stop macro otherwise continue with copy pasting. :-)

    Thanks a lot

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Copy Filtered data and stop macro when filter is empty

    Hi Andy

    See if this works for you...
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    260

    Re: Copy Filtered data and stop macro when filter is empty

    Waaaauuuu, nic work. It's working, thanks a lot :-)

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Copy Filtered data and stop macro when filter is empty

    You're welcome...glad I could help. Thanks for the Rep.

+ 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. Copy filtered Range, Remove Filter, Find 1st Empty Cell from the bottom, Paste VBA
    By intervals in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-29-2016, 10:48 PM
  2. filter and copy filtered data to another sheet based on combobox selection
    By prince82 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-09-2015, 11:09 PM
  3. Macro that can filter excel data and copy the filtered data to another worksheet
    By glide2131 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2013, 02:43 PM
  4. Replies: 5
    Last Post: 05-23-2012, 10:33 AM
  5. Replies: 3
    Last Post: 03-15-2012, 10:01 PM
  6. Need a macro to filter data then email filtered data through lotus notes (or print)
    By Crimson Bourne in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-17-2012, 01:26 PM
  7. Replies: 5
    Last Post: 12-13-2011, 12:40 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