View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.newusers
AndrewArmstrong AndrewArmstrong is offline
external usenet poster
 
Posts: 24
Default Separate Button for Auto Filter Selected Range

Create button using Control toolbox, right click on button and select
"view code", then enter the following

Private Sub ButtonXYZ_Click()
Columns("a:a").AutoFilter Field:=1, Criteria1:="XYZ",
visibledropdown:=False
End Sub

If you wanted to autofilter a specific range, you could replace
columns("a:a") with a range, such as range("a1:a5")
The visible drop-down is the autofilter arrow that appears in the first
cell in the range, it can be toggled on/off with true/false.

Regards,
Andrew J Armstrong