I'm pretty new when it comes to Visual Basic, so excuse me if my code is horrid.
I'm trying to implement a scroll bar where the incremental value (SmallChange and LargeChange) changes as the value increases decreases. I've tried if statements in different form but have not had much success. The best I got was
that the increment properties changed (based on a value off of another cell) but for some reason the scroll bar itself still didn't work as it should have.
Anyways, here's the code I got:
This is what 'works' but isn't what I want, (also just a test of numbers)
Private Sub ScrollBar1_Change()
If Sheet1.Range("D4") <= 100 Then
Sheet1.ScrollBar1.SmallChange = 1
Sheet1.ScrollBar1.LargeChange = 5
ElseIf Sheet1.Range("D4") = 1000 Then
Sheet1.ScrollBar1.SmallChange = 100
Sheet1.ScrollBar1.LargeChange = 50
End If
End Sub
This is more what I want but doesn't work,
Private Sub ScrollBar1_Change()
If Sheet1.ScrollBar1.Value <= 1 Then
Sheet1.ScrollBar1.SmallChange = 0.1
Sheet1.ScrollBar1.LargeChange = 0.5
ElseIf Sheet1.ScrollBar1.Value <= 100 Then
Sheet1.ScrollBar1.SmallChange = 1
Sheet1.ScrollBar1.LargeChange = 5
ElseIf Sheet1.ScrollBar1.Value <= 1000 Then
Sheet1.ScrollBar1.SmallChange = 50
Sheet1.ScrollBar1.LargeChange = 10
End If
End Sub
Moved From: Excel / Windows 10 / Office 365 Home