I appreciate the the extra effort you've taken to document your efforts. Thank you.
I frequently reset bloated books using the methods that don't work for you. There are only two differences I can identify:
The first is that I've never tried to right-click -> delete. I'm a keyboard guy so I've always used Alt+E+D. That shouldn't matter one bit, but stranger things have happened.
The second difference is that I've never been stuck like you, it always resets after saving. Big help there, right?
A few possible solutions follow:
Today I had an issue where my VBA merged sheets vertically and my worksheet inexplicably bloated horizontally. I was initially confused and concerned because I've only had vertical bloat and didn't think to check horizontally, until my reset attempt failed twice. Please humor me for the sake of completeness and to keep that from happening to you:
- Begin by closing any other Excel sessions, so the current workbook is the only workbook open.
- Go to the of your data on the right side and select the first empty column - the whole column.
- Alt+E, then D.
- Alt+E, then D.
- Scroll to the bottom of your data
- Select the first empty row - the whole row.
- Alt+E, then D.
- Alt+E, then D.
Yes, the two Ctrl+Shift+End lines are redundant, but I think your can survive the 15 keystrokes.
You "shouldn't" need to close your workbook after saving it, but I won't advise against it. Give it a shot. If that doesn't work, well - try VBA real quick.
The VBA Way
Don't be afraid of the big bad VBA, it's a great tool and what we're doing well only take a few seconds.
- Make sure the suspected worksheet is open and active.
- Alt+F11 to open the editor.
- Ctrl+G to open the immediate window.
?activesheet.usedrange.address and press Enter.
- If the range looks normal (not excessively large) then the problem is not your range.
- If the range is excessively large. then type
activesheet.usedrange and press Enter. Note the first command used a
? and this doesn't. That's because the question mark is used when we want VBA to display text, so we can see a value or status. If we don't use a question mark, then we're telling VBA to perform an action.
- Once you've pressed Enter, put your cursor on the line where you used the
? and press Enter.
- if the range changed then you're done. If it's the same, then you still have a problem.
Very Hidden Worksheets
The final task is to look for hidden worksheets. Not just hidden, but very hidden (I'm not making this up).
- The project explorer should already be open on the left side of the screen. Press Ctrl+R if it isn't.
- The window has minor differences between Excel versions, but they all share the same expanding/collapsing tree behavior.
- The number of projects displayed depends on the number of open Excel workbooks and addins. If you closed all other workbooks and there are more than a few projects showing, then you've got something else going on that we can cover in detail later.
- For now, find your project and expand the folders to expose the workbook objects (the individual worksheets and the
ThisWorkbook object). You'll recognize them because they will have your worksheet names in brackets.
- Once found, look for a name that isn't listed in your workbook with a worksheet tab.
- if you find one, select it in the explorer window and go to the properties window (below the explorer or F4).
- Scroll down to find visible, it should be one of two values:
- Click inside the value to open a drop-down menu, and select
- If it is neither of these, then you've selected the wrong sheet and possibly wrong project, - double check your selections.
- If you found and un-hid the sheets, then go back to every one of them and reset those ranges to see if your book shrunk (don't forget to re-hide the sheets.
FYI: A very hidden sheet is not listed in the hide/unhide context menu in Excel, so it's one of the better ways way to protect configurations and helper columns.
- We're done with VBA, so close the editor and go back to Excel. Press Ctrl+F3 to open the name manager.
- Look for unexpected named ranges. I generally don't recommend deleting named ranges unless you are very familiar with your workbook, because a lot of productive Excel/VBA solutions will not function properly if you remove a range they need; however, if you find a range with errors, pointing to non-existent workbooks, referencing unused ranges, or with some other blatantly wrong value - then they are ripe for removal.
Some Other Helpful Advice
This is significantly longer than I anticipated so I'll try to wrap it up ...
Check your Conditional formatting - just like named ranges, you're looking for blatantly wrong or reproduced conditions.
Check your queries and data models.
Verify you don't have pictures/charts/
listobjects in a hard to find location (the check we did with name manager should catch most, but not all, of them).
Verify you don't have custom configuration settings out of whack (I noticed a colleague's style gallery on the home tab was populated with the same 20% accent, and expanding it revealed hundreds. Using the VBA editor, I typed
?activeworkbook.styles.count and it returned more than 19,000; for comparison, mine had 47).
Watch for excessive formatting - a few hundred thousand rows of numbers formatted as currency is not the same as a few hundred thousand rows formatted with cell borders patterned like a maze filed with different colors and many different custom number formats, symbols, and fonts.
Check the data itself, a few hundred rows spanning 20 columns with every cell filled to the limit would be an embarrassing - but possible - cause of bloat
And lastly, the nuclear option. Save each sheet separately as a CSV text file and import it into a new workbook... this thing is guaranteed to work unless you have corrupt data - but rebuilding your formats, connections, and bla bla bla could be a pain.