+ Reply to Thread
Results 1 to 2 of 2

Usedrange has more rows than actual dataset

  1. #1
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    425

    Usedrange has more rows than actual dataset

    Hi,

    In my spreadsheet i fill a column with certain data with an if loop. I use the usedrange object as the range. Somehow the columns
    get filled with data to row nr 100 while the data was originally filled to column 20. Probably it has anything to do with an previous dataset in the sheet.
    How can i fix this?


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Usedrange has more rows than actual dataset

    Lots of things can affect UsedRange, not least formatting. If you want to reset UsedRange for a given worksheet, most robust to select the entire worksheet, delete either all rows or all columns, and save the workbook. UsedRange should revert to Nothing.

    That said, if you're always entering something in column A, you can restrict yourself to the bottommost nonblank row in column A using something like the following.

    Please Login or Register  to view this content.
    Then use rng rather than UsedRange.

+ 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. activesheet.usedrange.rows.count
    By kisanvikas2015 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2015, 09:34 AM
  3. [SOLVED] change the end of "usedrange" to the actual end of the used range :-)
    By JasperD in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-24-2014, 06:37 AM
  4. How to I tell UsedRange to not include certains rows?
    By Ejb123erok in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-26-2013, 06:15 AM
  5. How can i use UsedRange.Rows.Count if any blank rows embeded into the sheet
    By amarendra19 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2011, 11:52 AM
  6. ActiveSheet.UsedRange.Rows.Count
    By Kjaer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2007, 05:51 AM
  7. Real Value of .UsedRange.Rows.Count
    By dazman in forum Excel Formulas & Functions
    Replies: 23
    Last Post: 09-06-2005, 09:05 PM

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