The code wasn't an attempt to get by the arrows showing up (or not showing up),
it was just to show you a way not to have to rely on the data being in A1
through some column in row 1.
Maybe you could add a row under the header row -- keep it empty. Then apply the
filter to that row and the data below. And hide that empty row with the arrows.
CLR wrote:
Thanks Dave, but it does the same thing about killing the Autofilter when it
kills the arrow on the filtered column..........guess I'll just have to
cheat <g
Vaya con Dios,
Chuck, CABGx3
"Dave Peterson" wrote in message
...
I don't remember enough about xl97 to know about visibledropdown not being
there.
But in xl2k+ you could use this to be more specific about the range:
Sub HideArrows()
'hides all arrows except column 2
Dim c As Range
Dim i As Long
Application.ScreenUpdating = False
i = 0
For Each c In activesheet.autofilter.range.rows(1).cells
i = i + 1
if i < 2 then
c.AutoFilter Field:=i, Visibledropdown:=False
End If
Next c
Application.ScreenUpdating = True
End Sub
Then you don't have to worry about what row and what column the autofilter
range
starts.
CLR wrote:
Here's the whole code.
Sub HideArrows()
'hides all arrows except column 2
Dim c As Range
Dim i As Integer
i = Cells(1, 1).End(xlToRight).Column
Application.ScreenUpdating = False
For Each c In Range(Cells(1, 1), Cells(1, i))
If c.Column < 2 Then
c.AutoFilter Field:=c.Column, _
Visibledropdown:=False
End If
Next
Application.ScreenUpdating = True
End Sub
If I have Autofilter applied and then run this macro, it gets down to
the
errant part and gives the error message, then when I click "Debug" it
goes
ahead and hides the arrows...........but leaves me hung up on that line
of
code.
Vaya con Dios,
Chuck, CABGx3
"Dave Peterson" wrote in message
...
I think it could be lots of things--from worksheet protection to what
c
is.
Maybe more code and more description about your data--did you apply
filters
already or what?
CLR wrote:
That's cool Dave, thanks, it basically works, but I have a little
problem
with it in my XL97
the following returns an error of "1004 Autofilter method of range
class
failed"
c.AutoFilter Field:=c.Column, _
Visibledropdown:=False
Any idea how to fix?
Vaya con Dios,
Chuck, CABGx3
"Dave Peterson" wrote in message
...
Debra Dalgleish knows how:
http://contextures.com/xlautofilter03.html#Hide
CLR wrote:
Hi All........
Anyone know if it's possible to programmatically turn off the
DownArrows
on
the display while leaving the Autofilter in it's filtered
state?.....
I would like for my user to see only the Autofiltered results,
and
not
be
aware that they can reorder them with the downarrows.
Otherwise, can I call my autofilter with code, then freeze it so
the
downarrows do not work manually until I release them with more
code.
TIA
Vaya con Dios,
Chuck, CABGx3
--
Dave Peterson
--
Dave Peterson
--
Dave Peterson
--
Dave Peterson