View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default ActiveSheet.ShowAllData

This is a commandbutton placed on a worksheet?

If yes:

with me
if .filtermode then
.showalldata
end if
end with

If it's a commandbutton on a userform, then using Activesheet makes sense.

oldjay wrote:

This fails at the last line "ShowAllData method of worksheet class failed" if
there is no filtering active

Private Sub CommandButton1_Click() 'Clears all filters
Range("A3").Select
ActiveSheet.ShowAllData
End Sub

End Sub


--

Dave Peterson