Part of my program pastes several columns of data in a worksheet, then removes duplicate values in each column (with the variable range to search for duplicate values called rngDelete), then counts the number of unique values. After getting the count values, I delete all the rows in rngDelete.
But I notice that after deleting the rows, my vertical scroll bar length still remains the same, i.e. the same length as when I had data in rngDelete rows. It is true that re-opening the worksheet will reset the scroll bar length, but I was wondering if there is a way to force this to happen upon program runtime completion?
Press Ctrl + Shift + Right Arrow to select all the columns to the right. Then, once again, click Home > Clear > Clear All. Now we have cleared all the unnecessary content, save the document (Ctrl + S). The used range has now been reset, and the scroll bars should return back to a more usable size.
To use the arrow keys to move between cells, you must turn SCROLL LOCK off. To do that, press the Scroll Lock key (labeled as ScrLk) on your keyboard. If your keyboard doesn't include this key, you can turn off SCROLL LOCK by using the On-Screen Keyboard.
Excuting the following resets the lastcell and does what you want.
ActiveSheet.UsedRange.SpecialCells (xlCellTypeLastCell)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With