+ Reply to Thread
Results 1 to 6 of 6

Can't Reset UsedRange

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Can't Reset UsedRange

    I have the codes below as macros in my Add-In. I use the FindUsedRange macro to determine what my used range actually is. I use the ResetUsedRng macro to reset the used range, but sometimes my Reset macro won't work, for instance with the attached workbook. Everything I've read indicates that it should, but after running Reset, saving, closing, and reopening, FindUsed tells me the used range is still what it was before, which is the wrong used range. I've tried copying the macro to the workbook and running it from there, and it still won't reset the used range. I'm at my wits end; how do I reset it?
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Can't Reset UsedRange

    Does the workbook have any whole column formatting?
    Empty cells with formatting other than Style Normal will increase the .UsedRange of a sheet.

    I'm also a bit curious, if you have RealUsedRange, why concern yourself with Excel's UsedRange at all?
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Can't Reset UsedRange

    Because even though in VBA I can use RealUsedRange, my add-in is used by a lot of folks who aren't conversant with VBA, and for them all they want to do is reset their used range so using the END button has real meaning.

    I don't think there's any whole-column formatting going on. The columns are all formatted as General.

  4. #4
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Can't Reset UsedRange

    Found a possible partial fix from the Contexture site (http://www.contextures.on.ca/xlfaqApp.html#Unused). I married the two macros Debra had there into one. However, the code won't work with merged cells, and it doesn't fix used range issues BEFORE the used range. For example, my example file had data starting in Row2 and Column2, so Row1 and Column1 are unused. The code doesn't delete them (which is good) but they ARE still counted in the UsedRange (which is NOT good).
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    10-02-2008
    Location
    Berkeley, CA
    MS-Off Ver
    Windows 2007
    Posts
    105

    Re: Can't Reset UsedRange

    If you end up here, click here. It's dumb from excel's point of view, but it worked for me.

  6. #6
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Can't Reset UsedRange

    Yep, I've had to do that many times.
    I know I'm not stupid, but I suspect I'm a lot stupider than I think I am

+ 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. [SOLVED] usedrange doesn't reset when using 'application.activesheet.usedrange'
    By JasperD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2015, 10:39 PM
  2. 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
  3. Extremely High UsedRange - Cannot reduce/reset!
    By KaiserW in forum Excel General
    Replies: 3
    Last Post: 01-03-2013, 05:17 PM
  4. UsedRange
    By azizrasul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-23-2008, 06:21 AM
  5. [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
  6. Reset UsedRange
    By tjtjjtjt in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-31-2005, 10:05 AM
  7. [SOLVED] usedRange
    By GC in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-31-2005, 09:06 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