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
 

Some videos you may like

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

tactps

Well-known Member
Joined
Jan 20, 2004
Messages
3,459
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.
 

Tom Urtis

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,225
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
 

Watch MrExcel Video

Forum statistics

Threads
1,123,323
Messages
5,600,954
Members
414,417
Latest member
Nobu

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
Top