+ Reply to Thread
Results 1 to 4 of 4

Out of memory when trying to delete all unused rows

  1. #1
    Registered User
    Join Date
    08-14-2011
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    63

    Out of memory when trying to delete all unused rows

    Hi All,

    I have read in some source that in order to keep the size of excel file to minimum it is necessary to delet all the unused rows before saving the file.
    Somehow the tricks works..

    However, when I am trying to incorporate the step to delete all unnecessary rows after running a module using vba, the result is that I am out of memory. When doing it manually, the computer only reminds me of the possible memory run-out but the process itself can still be done.

    I am using the following macro code to delete the row:

    Please Login or Register  to view this content.
    lr1 is the last filled cell in column A, lrend is basicall 1048576 and colend is XFD or 16384

    Any suggestion in making the above works and not resulting in crash?

    Thanks in advance..

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Out of memory when trying to delete all unused rows

    Instead of Clearcontents use Clear which will remove all the unnecessary clusters.

    Please Login or Register  to view this content.
    Deletion will delete and create new set of cells/rows which takes more time. Because of deleting the rows it just resets the row height and nothing specail.

    So Clear method is enough in your case


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    08-14-2011
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Out of memory when trying to delete all unused rows

    Quote Originally Posted by :) Sixthsense :) View Post
    Instead of Clearcontents use Clear which will remove all the unnecessary clusters.

    Please Login or Register  to view this content.
    Deletion will delete and create new set of cells/rows which takes more time. Because of deleting the rows it just resets the row height and nothing specail.

    So Clear method is enough in your case
    Actually I commented out the clearcontents since after that method the size of my file still becomes larger.
    What I want to achieve is to delete the rows, however deleting the rows causing my calculation to crash due to insufficient memory.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Out of memory when trying to delete all unused rows

    If you want to delete then there is no need to clear the data, instead you can straight away delete the range by turning off the calculation like the below.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-14-2011
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Out of memory when trying to delete all unused rows

    Quote Originally Posted by :) Sixthsense :) View Post
    If you want to delete then there is no need to clear the data, instead you can straight away delete the range by turning off the calculation like the below.

    Please Login or Register  to view this content.
    It appears that using that syntax still required much memory and causing my calculation to stop and showing Run-time error '1004' on that particular syntax

  6. #6
    Registered User
    Join Date
    08-14-2011
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Out of memory when trying to delete all unused rows

    double posting..
    Last edited by a_driga; 09-22-2014 at 09:28 PM.

+ 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 Unused Rows
    By Kimsann in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2013, 11:54 PM
  2. Replies: 5
    Last Post: 11-12-2012, 08:38 PM
  3. Delete unused coloumn & rows
    By sanjeevi888 in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 10-12-2012, 04:35 PM
  4. [SOLVED] Delete unused rows or limit worksheet to only filled in cells?
    By youngtusk87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-30-2012, 01:03 AM
  5. Delete unused rows
    By schpanky in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2007, 02:22 PM

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