+ Reply to Thread
Results 1 to 3 of 3

Delete all empty rows

  1. #1
    Forum Contributor
    Join Date
    03-14-2005
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    329

    Delete all empty rows

    Hello

    I have this code that should delete all rows that are empty in my sheet.
    It seem to try to delete all rows that are empty which creates and infinite loop and the macro never stops.
    When I select only within a certain range (row1-954) it works very well. Row 954 is the last row with values in.

    How can I change this so it deletes only between row 1 and the last row where there is values?

    /Anders

    Please Login or Register  to view this content.

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Delete all empty rows

    Something like this...
    Please Login or Register  to view this content.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Delete all empty rows

    Hi,

    Try adding this to your code, before your 'we work backwards' comment
    Please Login or Register  to view this content.
    This will select the entire working range (like pressing Ctrl-Home then Ctrl-Shift-End).
    I've just tried it with your code and this works, though a VBA guru can probably suggest a better way of doing it .
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

+ 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. Delete Empty Rows and empty columns from the word table
    By mvneema in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2014, 10:51 AM
  2. [SOLVED] Delete empty rows
    By Danielle22 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-18-2013, 09:41 AM
  3. Delete empty rows
    By si14 in forum Excel General
    Replies: 1
    Last Post: 05-30-2012, 08:55 AM
  4. delete duplicate rows, delete empty rows
    By loade in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-03-2012, 05:42 AM
  5. how to delete empty rows
    By jgomez in forum Excel General
    Replies: 5
    Last Post: 03-09-2011, 11:47 AM
  6. Autofilter/delete empty rows is deleting non-empty rows!
    By oOarthurOo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-05-2010, 12:31 PM
  7. delete empty rows
    By vrijbergen in forum Excel General
    Replies: 1
    Last Post: 10-04-2005, 05:05 PM
  8. Delete Empty Rows
    By pegbol in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2005, 12:14 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