Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset Excel Vertical Scroll Bar length (without closing, then re-opening Workbook)

Tags:

excel

vba

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?

like image 211
Brian Mustang Avatar asked Jun 07 '14 17:06

Brian Mustang


People also ask

How do I reset the vertical scroll bar in Excel?

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.

How do I fix scrolling in Excel?

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.


1 Answers

Excuting the following resets the lastcell and does what you want.

ActiveSheet.UsedRange.SpecialCells (xlCellTypeLastCell)
like image 119
dcromley Avatar answered Oct 14 '22 04:10

dcromley