Scroll bar increments select case?

J

JeffMelton

I'm trying to change the increments of a scrollbar using select case,
but I can't quite get it, I'm sure its not too tough. Anybody have any
advice?

Sub ScrollBar3_Scroll()


Select Case Range("AJ7").Value
Case 101 To 199
ScrollBar3.SmallChange = 1
Case 200 To 298
ScrollBar3.SmallChange = 2
Case 300 To 395
ScrollBar3.SmallChange = 5
Case 400 To 590
ScrollBar3.SmallChange = 10
Case 600 To 980
ScrollBar3.SmallChange = 20
End Select

End Sub
 
J

JeffMelton

I've tried changing the code to this, but now I'm getting error 400 I'm
not really sure what to do.

Sub ScrollBar1_Scroll()

Select Case Range("L10")
Case 101 To 199
ActiveSheet.OLEObjects("ScrollBar1").Object.SmallChange = 1
Case 200 To 298
ActiveSheet.OLEObjects("ScrollBar1").Object.SmallChange = 2
Case 300 To 395
ActiveSheet.OLEObjects("ScrollBar1").Object.SmallChange = 5
Case 400 To 590
ActiveSheet.OLEObjects("ScrollBar1").Object.SmallChange = 10
Case 600 To 980
ActiveSheet.OLEObjects("ScrollBar1").Object.SmallChange = 20
End Select

End Sub
 
N

NickHK

Jeff,
I see this code in the _Scroll event.
This does not fire if you click on the end arrows to change the value.
Surprisingly the _Click event fires for this.
I'm not sure what you are trying to achieve, but I not sure resetting the
..SmallChance every time you scroll is a good idea.
You reset it when the value in AJ7 changes.

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top