Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default What is a clean way of controlling Scroll bars when using filters with Userforms?

What are some clean ways of handling Record xxx of yyy, and also scroll bar
functions if you are turning on and off filters and skipping hidden (the
recognition of hidden is controlled by a button) I have some issues (they
are minor compared to the functionality I have gained by controlling hidden
rows!) issues with out of ranges, and beggining of file etc with my current
scroll and record count/display functions.

Here is the code I have for controlling the filters.

Dim FiltOn As Boolean

Private Sub CommandButton38_Click()
FiltOn = True

End Sub

Private Sub CommandButton39_Click()
FiltOn = False

End Sub
Private Sub SpinButton1_SpinDown()
ActiveCell.Offset(1, 0).Select
If FiltOn Then
Do While Selection.Rows.Hidden = True
ActiveCell.Offset(1, 0).Select
Loop
End If

SetForeColor 'conditional formating based on value of offset 43
FillMyForm1
End Sub


Private Sub SpinButton1_Spinup()
ActiveCell.Offset(-1, 0).Select
If FiltOn Then

Do While Selection.Rows.Hidden = True
ActiveCell.Offset(-1, 0).Select
Loop
End If

SetForeColor 'conditional formating based on value of offset 43
FillMyForm1
End Sub



Thanks!
Bruce






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default What is a clean way of controlling Scroll bars when using filters with Userforms?

Sub AA_Tester12()
Dim rng As Range
Dim rng1 As Range
Dim rng2 As Range
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))
MsgBox "rec selected is " & recno & " of " & rng1.Count & " visible"
End If
End If

End Sub


What kind of scrollbar are you using? Control toolbox toolbar or Forms
toolbar?

--
Regards,
Tom Ogilvy

"Bruccce" wrote in message
et...
What are some clean ways of handling Record xxx of yyy, and also scroll

bar
functions if you are turning on and off filters and skipping hidden (the
recognition of hidden is controlled by a button) I have some issues (they
are minor compared to the functionality I have gained by controlling

hidden
rows!) issues with out of ranges, and beggining of file etc with my

current
scroll and record count/display functions.

Here is the code I have for controlling the filters.

Dim FiltOn As Boolean

Private Sub CommandButton38_Click()
FiltOn = True

End Sub

Private Sub CommandButton39_Click()
FiltOn = False

End Sub
Private Sub SpinButton1_SpinDown()
ActiveCell.Offset(1, 0).Select
If FiltOn Then
Do While Selection.Rows.Hidden = True
ActiveCell.Offset(1, 0).Select
Loop
End If

SetForeColor 'conditional formating based on value of offset 43
FillMyForm1
End Sub


Private Sub SpinButton1_Spinup()
ActiveCell.Offset(-1, 0).Select
If FiltOn Then

Do While Selection.Rows.Hidden = True
ActiveCell.Offset(-1, 0).Select
Loop
End If

SetForeColor 'conditional formating based on value of offset 43
FillMyForm1
End Sub



Thanks!
Bruce








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
scroll bars Cutearmychic Excel Worksheet Functions 1 August 22nd 08 08:53 PM
Scroll bars Tazzy via OfficeKB.com Excel Discussion (Misc queries) 3 December 10th 06 10:28 PM
Controlling Userforms harrysfan New Users to Excel 1 August 30th 06 12:47 PM
Scroll bars Embalmer Excel Discussion (Misc queries) 1 December 31st 05 05:05 PM
Help with Userforms and filters or autofilters Bruccce Excel Programming 0 July 31st 03 04:37 PM


All times are GMT +1. The time now is 08:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"