filters for selective columns?

E

evilchrissy

I have a spreadsheet with around 20 columns. i want the filter button only
on 10 of them. Easy enough if the columns are right next to eachother, i
figured out how to do that. My problem is that i only want the filter
buttons on columns a, c, e, f, h, l, and p. (these aren't the real columns,
just an example.) If it were up to me, i'd either leave all the buttons
showing, or move the columns i want filtered right next to eachother. The
problem with that is it's not up to me (I'm working on this spreadsheet for
three different supervisors and they have dictated the order they want to see
the columns in, and seeing the filter button at the top of columns they do
not want to filter annoys them.)

If I can't have the filter button on selective non-adjacent columns, is
there a way i could 'hide' the button on the columns that my bosses don't
want to see the filter button on?

Thanks in advance, any help would be appreciated.
 
R

RagDyer

It sounds as though you might be interested in "Custom Views".

Check out the Help files, and post back with any questions.
 
K

KC hotmail com>

Right-click that sheet's tab and select "View Code." Paste this macro in,
modify it to represent the columns you want the filter button on, press the
green play button, delete the macro, then exit the VBA editor window. That's
it!

Sub HideSomeArrows()
'hide some autofilter arrows
Dim c As Range
Dim i As Integer
'Assumes headers begin in A1 (1,1)...change as needed in both places below
i = Cells(1, 1).End(xlToRight).Column
Application.ScreenUpdating = False
For Each c In Range(Cells(1, 1), Cells(1, i))
Select Case c.Column
'These are the columns you want to show
'In this example, starting from A1, 2 is column B and 3 is column C
'So this will hide the filter button in column A and columns D to the end
Case 2, 3 'Change accordingly
c.AutoFilter Field:=c.Column, _
Visibledropdown:=True
Case Else
c.AutoFilter Field:=c.Column, _
Visibledropdown:=False
End Select
Next
Application.ScreenUpdating = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top