ebea
Active Member
- Joined
- Jul 12, 2008
- Messages
- 296
- Office Version
- 2021
- Platform
- Windows
Hi! I have a frustrating "little" problem, with a mulipage Form, that's when I switch between the Tabs, can't get the correct Sheet to list info, into Text boxes on the actual Tab. No matter which Tabs I select, it only list info from the first Tabs Sheet info.
I use the following code, to list through a list of numbers, which shows up in Text boxes. All that works correct, with exception, that the Sheet reference do not follow, even that I define "Set" Sheet in the code.
Sub spn4(x As Integer)
Dim Rng As Range
Static c As Integer
Set Sh = Sheets("samling")
Set Rng = Range(Range("B3"), Range("B" & Rows.Count).End(xlUp))
c = c + x
If c >= Rng.Count Then c = Rng.Count
If c <= 0 Then c = 1
TextBox65 = Rng(c)
Call CommandButton9_Click
End Sub
Private Sub SpinButton4_SpinDown()
Dim p As Integer
p = -1
Call spn4(p)
End Sub
Private Sub SpinButton4_SpinUp()
Dim p As Integer
p = 1
Call spn4(p)
End Sub
I use the following code, to list through a list of numbers, which shows up in Text boxes. All that works correct, with exception, that the Sheet reference do not follow, even that I define "Set" Sheet in the code.
Sub spn4(x As Integer)
Dim Rng As Range
Static c As Integer
Set Sh = Sheets("samling")
Set Rng = Range(Range("B3"), Range("B" & Rows.Count).End(xlUp))
c = c + x
If c >= Rng.Count Then c = Rng.Count
If c <= 0 Then c = 1
TextBox65 = Rng(c)
Call CommandButton9_Click
End Sub
Private Sub SpinButton4_SpinDown()
Dim p As Integer
p = -1
Call spn4(p)
End Sub
Private Sub SpinButton4_SpinUp()
Dim p As Integer
p = 1
Call spn4(p)
End Sub