ShowAllData method of Worksheet class failed

后端 未结 7 1497
后悔当初
后悔当初 2020-11-28 10:17

I notice my VBA script doesn\'t work when there\'s an autofilter already on. Any idea why this is?

    wbk.Activate
    Set Criteria = Sheets(\"Sheet1\").Cel         


        
7条回答
  •  误落风尘
    2020-11-28 10:59

    This will work. Define this, then call it from when you need it. (Good for button logic if you are making a clear button):

    Sub ResetFilters()
        On Error Resume Next
        ActiveSheet.ShowAllData
    End Sub
    

提交回复
热议问题