Home |
Search |
Today's Posts |
#1
|
|||
|
|||
AutoFilter - non adjacent columns
Jim,
I am trying to do the same thing and when I use this code you provided I get a Run-time error '1004' Application-defined or object-defined error. Can you tell me what I'm doing wrong? Thanks, Richard "Jim Rech" wrote: You can have only one autofilter at a time in a worksheet. You can make some of the dropdowns disappear though, which may be what you want, but only by a macro as far as I know. This assumes the autofilter is already in place: ActiveSheet.AutoFilter.Range.AutoFilter field:=3, visibledropdown:=False -- Jim Rech Excel MVP "wladdr" wrote in message ... | How do I put AutoFilter on just a couple of non adjacent columns in a | worksheet. I know I've seen this, and maybe have done it before, but now I | get a "...cannot be performed with multiple selections..." error. Thank you. |
#2
|
|||
|
|||
Did you already apply Data|Filter|Autofilter to the activesheet?
Did you have at least 3 columns in that filtered range? Was the activesheet protected? Richard wrote: Jim, I am trying to do the same thing and when I use this code you provided I get a Run-time error '1004' Application-defined or object-defined error. Can you tell me what I'm doing wrong? Thanks, Richard "Jim Rech" wrote: You can have only one autofilter at a time in a worksheet. You can make some of the dropdowns disappear though, which may be what you want, but only by a macro as far as I know. This assumes the autofilter is already in place: ActiveSheet.AutoFilter.Range.AutoFilter field:=3, visibledropdown:=False -- Jim Rech Excel MVP "wladdr" wrote in message ... | How do I put AutoFilter on just a couple of non adjacent columns in a | worksheet. I know I've seen this, and maybe have done it before, but now I | get a "...cannot be performed with multiple selections..." error. Thank you. -- Dave Peterson |
#3
|
|||
|
|||
Jim,
I want to remove the filter for several columns (for example columns 4 thru 8), how can I modify your macro to do this? I've tried a few things, but can't seem to get the syntax right, can you help? Thanks "Jim Rech" wrote: You can have only one autofilter at a time in a worksheet. You can make some of the dropdowns disappear though, which may be what you want, but only by a macro as far as I know. This assumes the autofilter is already in place: ActiveSheet.AutoFilter.Range.AutoFilter field:=3, visibledropdown:=False -- Jim Rech Excel MVP "wladdr" wrote in message ... | How do I put AutoFilter on just a couple of non adjacent columns in a | worksheet. I know I've seen this, and maybe have done it before, but now I | get a "...cannot be performed with multiple selections..." error. Thank you. |
#4
|
|||
|
|||
I'm not Jim, but this removed the arrows from the 4-8 columns of the autofilter
range. Option Explicit Sub testme() Dim myRng As Range Dim iCol As Long Set myRng = ActiveSheet.AutoFilter.Range For iCol = 1 To myRng.Columns.Count Select Case iCol Case Is = 4, 5, 6, 7, 8 myRng.AutoFilter field:=iCol, visibledropdown:=False End Select Next iCol End Sub Superdan wrote: Jim, I want to remove the filter for several columns (for example columns 4 thru 8), how can I modify your macro to do this? I've tried a few things, but can't seem to get the syntax right, can you help? Thanks "Jim Rech" wrote: You can have only one autofilter at a time in a worksheet. You can make some of the dropdowns disappear though, which may be what you want, but only by a macro as far as I know. This assumes the autofilter is already in place: ActiveSheet.AutoFilter.Range.AutoFilter field:=3, visibledropdown:=False -- Jim Rech Excel MVP "wladdr" wrote in message ... | How do I put AutoFilter on just a couple of non adjacent columns in a | worksheet. I know I've seen this, and maybe have done it before, but now I | get a "...cannot be performed with multiple selections..." error. Thank you. -- Dave Peterson |
#5
|
|||
|
|||
Thanks Dave, very much appreciated, I'll give it a try !
"Dave Peterson" wrote: I'm not Jim, but this removed the arrows from the 4-8 columns of the autofilter range. Option Explicit Sub testme() Dim myRng As Range Dim iCol As Long Set myRng = ActiveSheet.AutoFilter.Range For iCol = 1 To myRng.Columns.Count Select Case iCol Case Is = 4, 5, 6, 7, 8 myRng.AutoFilter field:=iCol, visibledropdown:=False End Select Next iCol End Sub Superdan wrote: Jim, I want to remove the filter for several columns (for example columns 4 thru 8), how can I modify your macro to do this? I've tried a few things, but can't seem to get the syntax right, can you help? Thanks "Jim Rech" wrote: You can have only one autofilter at a time in a worksheet. You can make some of the dropdowns disappear though, which may be what you want, but only by a macro as far as I know. This assumes the autofilter is already in place: ActiveSheet.AutoFilter.Range.AutoFilter field:=3, visibledropdown:=False -- Jim Rech Excel MVP "wladdr" wrote in message ... | How do I put AutoFilter on just a couple of non adjacent columns in a | worksheet. I know I've seen this, and maybe have done it before, but now I | get a "...cannot be performed with multiple selections..." error. Thank you. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Columns | Excel Discussion (Misc queries) | |||
compare contents of two adjacent columns | Excel Worksheet Functions | |||
Copying multiple columns not adjacent | Excel Discussion (Misc queries) | |||
combining adjacent columns | Excel Discussion (Misc queries) | |||
Possible to apply Autofilter to a subset of available columns? | Excel Discussion (Misc queries) |