+ Reply to Thread
Results 1 to 3 of 3

Copying filtered data when there are no cells to show

  1. #1
    Registered User
    Join Date
    08-09-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    22

    Copying filtered data when there are no cells to show

    Hi Everyone,

    I am creating a report in Excel by combining two reports downloaded from our system. The one (secondary) report is additional information that is being filtered and copied over to the "main" spreadsheet. This secondary report is filtered to show only accounts that are "Overbilled", "Documents Required" or "Overbilled/Documents Required". This part of my macro is all working fine. My problem arises when this filter results in a "blank" (no results to show) spreadsheet. Depending on which branch I'm working on, there are times when there are no issues, so there are no lines of data for the macro to copy. When there is no data left in the table, the macro is copying the headers and pasting them into the workbook, which I don't want. Is there any way to change the macro so it doesn't do this? Can you tell the macro to copy data when there is data but skip steps when there isn't or something like that? I've attached that part of my macro for reference:

    Please Login or Register  to view this content.
    Thanks!
    canadian_chickie

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Copying filtered data when there are no cells to show

    Try it like this:

    Please Login or Register  to view this content.
    Hope this helps.

    Pete

    EDIT: I've coloured the two added lines red, for clarity
    Last edited by Pete_UK; 08-17-2012 at 12:03 PM.

  3. #3
    Registered User
    Join Date
    08-09-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Copying filtered data when there are no cells to show

    Works like a charm! Thank you so much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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