OK... So I have made some progress...
Now I have a working scrollbar on the form that loops through the lines (and the form shows the data of the relevant line). Here is the code I am using:
Private Sub ScrollBar1_Change()
Lrow = Range("a10000").End(xlUp).Offset(1, 0).Row
ScrollBar1.Min = "2"
ScrollBar1.Max = Lrow
TextBox1.Value = ScrollBar1.Value 'Shows the current line number
SB_row = ScrollBar1.Value
Me.txt_AAA.Value = Cells(SB_row, 1).Value
Me.txt_BBB.Value = Cells(SB_row, 3).Value
Me.txt_CCC.Value = Cells(SB_row, 4).Value
Me.txt_DDD.Value = Cells(SB_row, 5).Value
Me.txt_EEE.Value = Cells(SB_row, 6).Value
Me.txt_FFF.Value = Cells(SB_row, 7).Value
Me.txt_GGG.Value = Cells(SB_row, 8).Value
Me.txt_HHH.Value = Cells(SB_row, 9).Value
End Sub
What I still need is the code to apply autofilter to the database (based on a value that the user selects from a ComboBox) and then - I need the scrollbar to loop through the visible lines only, because my data is pulled to the form based on the scrollbar value, so if the scrollbar will loop though visible lines only - the form will only show the visible data as well.
BTW, I will be very happy even with a solution that assumes the database is already filtered (from within the sheet, and not from the ComboBox on in the form...) and tells the ScrollBar to loop only through the visible cells.
Hope all this is clear, even though I have not provided an example.
:-)
Bookmarks