Why does Used Range select 1,000,000 rows

upobDaPlaya
upobDaPlaya used Ask the Experts™
on
When I use the below used range it selects over 1,000,000 rows ?  Why as I only have 5 rows of data...I even manually deleted row6+ and all Columns beyond COl D and still no luck..

Worksheets("Sheet1").Activate 
ActiveSheet.UsedRange.Select

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
After deleting the rows and columns, save, close and reopen your workbook.
Older than dirt
Most Valuable Expert 2017
Distinguished Expert 2018
Commented:
Do something like this, changing the range as needed.

Sub MakeWorkbookSmaller()
ActiveSheet.Range("A2761:DJ1048576").ClearFormats
End Sub

Open in new window

Author

Commented:
Perfect...thanks everyone
Martin LissOlder than dirt
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
You’re welcome and I’m glad I was able to help.

If you expand the “Full Biography” section of my profile you’ll find links to some articles I’ve written that may interest you.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange Most Valuable Expert (MVE) 2015, 2017
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2017
              Experts Exchange Top Expert VBA (current)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial