AUTOFILTER skipping columns

vlsi99

New Member
Joined
Feb 6, 2005
Messages
1
Hi:

Background (just an Excel user not a programmer)

I have a Spreadsheet with 20 columns across and 100 rows.
I want to add the autofilter button only to certain columns (skipping columns).

So far , the only way I know how to limit the number of columns with the autofilter on is by selecting consecutive columns.

My goal is to have for example:

Columns:


A (with filter buttom), B(with filter buttom), C(no filter Button), D(with filter button)



Is this possible?

thanks

Sergio
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Autofilter can only be used on consecutive columns. I suggest that you either:
1. Hide the columns that aren't required
2. Reorder the columns so that the ones not required are out of the range
3. Live with it
4. Use a data validation in a separate column to give you your drill-down.
 
Upvote 0
vlsi99 said:
I want to add the autofilter button only to certain columns (skipping columns).My goal is to have for example:
Columns:
A (with filter buttom), B(with filter buttom), C(no filter Button), D(with filter button)
Is this possible?
Yes it is possible with VBA, by invoking AutoFilter's VisibleDropDown argument and setting it to False where you want.

For example, running this macro would give you the drop-downs where you said you want them (A, B, and D), and omit it from C. This assumes your header row is 1.


Sub Test1()
With Range("A1")
.CurrentRegion.AutoFilter
.AutoFilter Field:=3, VisibleDropDown:=False
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,516
Messages
6,119,980
Members
448,934
Latest member
audette89

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top