+ Reply to Thread
Results 1 to 2 of 2

Autofilter/delete empty rows is deleting non-empty rows!

  1. #1
    Registered User
    Join Date
    08-05-2009
    Location
    Winnipeg, Canada
    MS-Off Ver
    Excel 2003
    Posts
    61

    Autofilter/delete empty rows is deleting non-empty rows!

    Greetings, I'm currently running this code when the sheet deactivates to delete empty rows from a worksheet:

    Please Login or Register  to view this content.
    The problem is, if there are less than two records in the worksheet, it will delete the heading row, breaking my dynamic named ranges and tables based on same.

    I tried adding a check like this:
    Please Login or Register  to view this content.
    But this doesn't seem to work. Appreciate code / ideas to help!

    EDIT: I should add that a new row is generated automatically when the last record has been completed, in anticipation of the user needing to enter another record. But if they don't actually need to enter anything, then I have to remove that blank row so that my dynamic named ranges don't include it in the range, thus messing up tables/pivot tables.
    Last edited by oOarthurOo; 05-05-2010 at 11:03 AM. Reason: Clarification

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Autofilter/delete empty rows is deleting non-empty rows!

    Maybe this:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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