• Cannot delete rows (2003)

    • This topic has 4 replies, 3 voices, and was last updated 17 years ago.
    Author
    Topic
    #449960

    The spreadsheet is about 10000 rows. I created a subtotal function, then collapsed the spreadsheet to show only the level “2” items. Inserted a blank column and entered a formula. I inadvertently copied it to the bottom of the spreadsheet instead of to the bottom of the data area (1000 0 rows). No problem — just delete the formula from from cells in rows 10000 to 65000… Oops — that’s not sufficient. When I try to un-collapse the subtotals, Excel issues an error message that it “cannot shift objects off sheet”. When I press Ctrl-End, the cursor goes all the way to row 65000+

    I tried to select all the rows below 10000, but Excel became unresponsive, and I had to shut it down using Task Manager. It appears to be impractical to select and delete more than about 100~200 rows at a time before Excel becomes unresponsive.

    Is there an easy way to delete all the rows between 10000 and 65000?

    Viewing 1 reply thread
    Author
    Replies
    • #1104501

      Does it work better if you set calculation to Manual in the Calculation tab of Tools | Options…? (Don’t forget to set it to Automatic again afterwards).

      If that doesn’t work, perhaps using VBA?
      – Press Alt+F11 to activate the Visual Basic Editor.
      – Press Ctrl+G to activate the Immediate window.
      – Type

      Range("A10001:A65536").EntireRow.DeleteContents

      or

      Range("A10001:A65536").EntireRow.Delete

      and press Enter.

      • #1104578

        Setting recalc to “manual” made no difference.

        I have launched the VBA solution (Range(“A10001:A65536”).EntireRow.Delete) and my CPU has been pegged at 100% utilization for the past 5 minutes according to Windows Task Manager. No indication how long it will remain pegged at 100%. While it’s deleting those rows, Excel is completely unresponsive to other inputs.

        It sure is a lot easier to inadvertently *create* those rows than it is to delete them!

        Thanks once again for your help.

      • #1104580

        FYI

        I got impatient, and killed the Excel process after about 10 minutes. Re-jigged the VBA statement to delete 10000 rows, which took about 3-4 minutes, so deleting the 50000+ rows would probably take about 15-20 minutes. Anyway, I can now work with the spreadsheet again.

    • #1104556

      If Hans’ method doesn’t work, you may need to remove the subtotals, delete the blank rows, then reapply the subtotals.

    Viewing 1 reply thread
    Reply To: Cannot delete rows (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: