Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel 方法Sheet1.ShowAll和Sheet1.AutoFilter.ShowAll之间有什么区别_Excel_Vba - Fatal编程技术网

Excel 方法Sheet1.ShowAll和Sheet1.AutoFilter.ShowAll之间有什么区别

Excel 方法Sheet1.ShowAll和Sheet1.AutoFilter.ShowAll之间有什么区别,excel,vba,Excel,Vba,我录制了一个宏以清除过滤器并显示所有行数据。结果是Sheet1.ShowAll。我使用此方法很长一段时间,但有时会出现错误,可以使用Sheet1.AutoFilter.ShowAll修复。Sheet1.AutoFilter.ShowAll为什么工作 我使用Excel 2010进行测试 Sheet1.ShowAll 'runtime error Sheet1.AutoFilter.ShowAll 'no error, why? Sheet1.ShowAllData是要清除过滤器的代码 但是如果

我录制了一个宏以清除过滤器并显示所有行数据。结果是Sheet1.ShowAll。我使用此方法很长一段时间,但有时会出现错误,可以使用Sheet1.AutoFilter.ShowAll修复。Sheet1.AutoFilter.ShowAll为什么工作

我使用Excel 2010进行测试

Sheet1.ShowAll 'runtime error

Sheet1.AutoFilter.ShowAll 'no error, why?

Sheet1.ShowAllData
是要清除过滤器的代码

但是如果您使用
Sheet1.UsedRange.AutoFilter
,它将删除过滤器,或者在未应用过滤器的情况下添加过滤器