Part | Description | |
object | Required. A valid object. | |
Long | Optional. An integer that specifies the amount of change to the Value property. |
Dim TempNum As Integer
Private Sub ScrollBar1_Change()
Label3.Caption = ScrollBar1.Value
End Sub
Private Sub TextBox1_Change()
If IsNumeric(TextBox1.Text) Then
TempNum = CInt(TextBox1.Text)
If TempNum >= 0 And TempNum <= 100 Then
ScrollBar1.SmallChange = TempNum
Else
TextBox1.Text = ScrollBar1.SmallChange
End If
Else
TextBox1.Text = ScrollBar1.SmallChange
End If
End Sub
Private Sub TextBox2_Change()
If IsNumeric(TextBox2.Text) Then
TempNum = CInt(TextBox2.Text)
If TempNum >= 0 And TempNum <= 100 Then
ScrollBar1.LargeChange = TempNum
Else
TextBox2.Text = ScrollBar1.LargeChange
End If
Else
TextBox2.Text = ScrollBar1.LargeChange
End If
End Sub
Private Sub UserForm_Initialize()
ScrollBar1.Min = -1000
ScrollBar1.Max = 1000
Label1.Caption = "SmallChange 0 to 100"
ScrollBar1.SmallChange = 1
TextBox1.Text = ScrollBar1.SmallChange
TextBox1.MaxLength = 3
Label2.Caption = "LargeChange 0 to 100"
ScrollBar1.LargeChange = 100
TextBox2.Text = ScrollBar1.LargeChange
TextBox2.MaxLength = 3
ScrollBar1.Value = 0
Label3.Caption = ScrollBar1.Value
End Sub