PDA

View Full Version : Sleeper: Help W/AutoFilter



OrphanBear
03-11-2009, 09:52 AM
Hi All,

I have this code that works almost as I want it. I have a sheet that is autofiltered. Once a user autofilters columns 20, I would like to hide the arrow for that column so the user can no longer autofilter using that column. When I run the code - it hides the arrow in column 20, but then it unfilters all the data . . . can I hide the arrow in column 20 but keep the data as it was filtered before the code ran?? Thanks,



Dim c As Range
Dim i As Integer
i = Cells(2, 1).End(xlToRight).Column
Application.ScreenUpdating = False
For Each c In Range(Cells(2, 1), Cells(1, i))
If c.Column = 20 Then
c.AutoFilter
Field:=c.Column, Visibledropdown:=False
End If
Next
End Sub

Bob Phillips
03-11-2009, 10:12 AM
Couple of questions?

What Excel version do you have?
Do you have dropdown arrows in all columns 1-20?
Is it OK to remove the dropdown period, it won't be recoverable.