+ Reply to Thread
Results 1 to 3 of 3

usedrange doesn't reset when using 'application.activesheet.usedrange'

  1. #1
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    usedrange doesn't reset when using 'application.activesheet.usedrange'

    hi guys and girls,

    the usedrange in my workbook is currently listed as $A$1:$FM$7729 for reasons unknown to me, as the last cell on sheet is $EJ$42 (according to debug.Print activesheet.cells.find(what:="*", searchdirection:=xlprevious).address)

    Normally, I can 'reset' the usedrange by simply typing application.activesheet.usedrange in the direct window, but on this workbook, it doesn't do anything.
    And I don't get why

    You might wonder why I think this is important - currently it is a 4MB workbook as it's saving the sheet with A1:FM7229, while it should just be saving A1:EJ42. Quite the difference in file size, I expect.

    I tried saving as xlsb for a while and while that greatly decreases filesize, it sometimes corrupts the workbook for no reason (that's a question for another thread ).

    So - does anyone have any idea how to make excel realize the sheet is quite a bit smaller than it thinks it is?
    Many thanks in advance!

    Jasper

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: usedrange doesn't reset when using 'application.activesheet.usedrange'

    OK, I solved it thanks to this thread

    I had to delete all conditional formatting, delete all rows and columns outside of $A$1:$EJ$42 and then used 'application.activesheet.usedrange' again.
    I don't understand why, but it worked.
    Props to TMS in the other thread for pointing me in the right direction.

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: usedrange doesn't reset when using 'application.activesheet.usedrange'

    Here is another thread to keep in mind Jasper.
    http://www.mrexcel.com/forum/excel-q...iece-code.html

+ 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. Reset Active Range - VBA ActiveSheet.UsedRange does not work
    By wesc in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-07-2015, 06:47 AM
  2. [SOLVED] For Each c In ActiveSheet.UsedRange.SpecialCells(xlCellTypeConstants)
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2014, 10:39 PM
  3. Activesheet.UsedRange - Type Mismatch
    By LB79 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-23-2009, 11:08 AM
  4. Type Mismatch - ActiveSheet.UsedRange
    By LB79 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-28-2009, 08:22 AM
  5. ActiveSheet.UsedRange.Rows.Count
    By Kjaer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2007, 05:51 AM
  6. [SOLVED] selecting ActiveSheet.UsedRange
    By Gary''s Student in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-12-2006, 11:35 AM
  7. [SOLVED] how to reset the activesheet usedrange value
    By Gary Keramidas in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-28-2005, 11:05 AM

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