PDA

View Full Version : ExcelDiet() For Excel 2007



mrlooneytoon
09-14-2010, 11:08 AM
Hey guys

I've tried searching the forums but the search function is a little weird.

Anyway, I'm trying to use the ExcelDiet() macro found on this website but it doesn't work for my .xlsx Excel 2007 spreadsheet. I'm guessing it's because my spreadsheet actually contains more than the IV65536 (specifically I have greater than 65,536 rows).

How can I modify the macro to make it work for Excel 2007?

I've tried changing the


.Range(Cells(1, LastCol + 1).Address & ":IV65536").Delete
.Range(Cells(LastRow + 1, 1).Address & ":IV65536").Delete


to


.Range(Cells(1, LastCol + 1).Address & ":XFD1048576").Delete
.Range(Cells(LastRow + 1, 1).Address & ":XFD1048576").Delete



But that didn't fix anything.

Please help! My file sizes are like 30+MB and are too big! Thanks

Bob Phillips
09-14-2010, 01:51 PM
.Range(.Cells(1, LastCol + 1), .Cells(.Rows.Count, .Columns.Count)).Delete
.Range(.Cells(Lastrow + 1, 1), .Cells(.Rows.Count, .Columns.Count)).Delete