Consulting

Results 1 to 2 of 2

Thread: Sleeper: Help W/AutoFilter

  1. #1

    Sleeper: Help W/AutoFilter

    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

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    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.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •