B
BruceJ
For my FILTERED records, I have this code that works.
Set rng = ActiveSheet.AutoFilter.Range
Set rng = rng.Offset(1, 0).Resize(rng.Rows.Count - 1, 1)
On Error Resume Next
Set rng1 = rng.SpecialCells(xlVisible)
On Error GoTo 0
If rng1 Is Nothing Then
' MsgBox "0 of " & rng.Count & " rows visible -"
Else
' MsgBox rng1.Count & " of " & rng.Count & " rows visible"
If Not Intersect(ActiveCell.EntireRow, rng1) Is Nothing Then
Set rng2 = Intersect(ActiveCell.EntireRow, rng1)
recno = Application.Subtotal(3, Range(rng1(1), rng2)) 'commewnted out
11/10/2003
'recno = ScrollBar1.Value 'added 11/10/2003
' MsgBox "rec selected is " & recno & " of " & rng1.Count & " visible"
Else
'recno = ScrollBar1.Value
' MsgBox "rec selected is " & recno & " of " & rng1.Count & "
visible"
'recno = ScrollBar1.Value - Ofs '- (ScrollBar1.Min - 1)
' Recno = ScrollBar1.Value
End If
End If
Label41.Caption = recno & " of " & rng1.Count
How can I do the same for when I have the filter flag set to disabled? The
sheet may still be filtered, but the HIDDEN are now available.
Is there a way to incorperate this with a scroll bar with out MASSIVE
rewritting? (this is being called now by my click_up() and click_dn()
functions
Thanks
Bruce
Set rng = ActiveSheet.AutoFilter.Range
Set rng = rng.Offset(1, 0).Resize(rng.Rows.Count - 1, 1)
On Error Resume Next
Set rng1 = rng.SpecialCells(xlVisible)
On Error GoTo 0
If rng1 Is Nothing Then
' MsgBox "0 of " & rng.Count & " rows visible -"
Else
' MsgBox rng1.Count & " of " & rng.Count & " rows visible"
If Not Intersect(ActiveCell.EntireRow, rng1) Is Nothing Then
Set rng2 = Intersect(ActiveCell.EntireRow, rng1)
recno = Application.Subtotal(3, Range(rng1(1), rng2)) 'commewnted out
11/10/2003
'recno = ScrollBar1.Value 'added 11/10/2003
' MsgBox "rec selected is " & recno & " of " & rng1.Count & " visible"
Else
'recno = ScrollBar1.Value
' MsgBox "rec selected is " & recno & " of " & rng1.Count & "
visible"
'recno = ScrollBar1.Value - Ofs '- (ScrollBar1.Min - 1)
' Recno = ScrollBar1.Value
End If
End If
Label41.Caption = recno & " of " & rng1.Count
How can I do the same for when I have the filter flag set to disabled? The
sheet may still be filtered, but the HIDDEN are now available.
Is there a way to incorperate this with a scroll bar with out MASSIVE
rewritting? (this is being called now by my click_up() and click_dn()
functions
Thanks
Bruce