如何重置Excel垂直滚动条长度(不关闭,然后重新打开工作簿) [英] How to reset Excel Vertical Scroll Bar length (without closing, then re-opening Workbook)

查看:629
本文介绍了如何重置Excel垂直滚动条长度(不关闭,然后重新打开工作簿)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序的一部分在工作表中粘贴了几列数据,然后删除了每一列中的重复值(用变量范围来搜索名为rngDelete的重复值),然后计算唯一值的数量。获取计数值后,我删除rngDelete中的所有行。



但是我注意到,删除行后,我的垂直滚动条长度仍然保持不变,即与rngDelete行中的数据相同的长度。确实,重新打开工作表将重置滚动条的长度,但我想知道是否有办法强制这样在程序运行时完成时发生?

  ActiveSheet.UsedRange。 SpecialCells(xlCellTypeLastCell)


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?

解决方案

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

ActiveSheet.UsedRange.SpecialCells (xlCellTypeLastCell)

这篇关于如何重置Excel垂直滚动条长度(不关闭,然后重新打开工作簿)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆