View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default chk box to filter or hide rows based on value in a column

I figured that letting excel guess worked for you before, it would work for you
in code.

(And I bet it still would if you don't have any gaps in that range.)

But the real problem was my mistake in this area:

If .AutoFilterMode Then
.ShowAllData
End If

Tom corrected it to:

If .AutoFilterMode Then
if .FilterMode then
.ShowAllData
End if
End If

..autofiltermode checks to see if you have those visible arrows applied.
..filtermode checks to see if you're actually filtering any of the columns.

(I had a brain freeze and my little testing wasn't much of a test.)

deanop wrote:

It worked like a champ...thanks...so it needed to know the end of the
autofilter range, but if u look at the code I created I did not have to
define an end for autofilter range, why did Dave's code failed to
execute.....Thx, deano


--

Dave Peterson