Spin Button with mouse down event

wagmanm

Board Regular
Joined
Feb 26, 2013
Messages
144
I would like to add a mousedown or auto repeat to this code. Can any give me any advise? I would like this code to repeat if the button is held down.

Private Sub SpinButton1_spinup()
range("f6").Value = range("f6").Value + 1
End Sub

Private Sub SpinButton1_spindown()
range("f6").Value = range("f6").Value - 1
End Sub


I have tried many things but cant seem to get it to work.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Is it an activeX spinbutton or on a userform?

Either way by holding down either of the buttons(up/down), the code should repeat, at least that's how it works for me

And AFAIK, there isn't any mouseup/mousedown event for a spinbutton
 
Upvote 0
It is an ActiveX button. I can not explain this, but now when I go to use it without making any changes it works perfectly. I have been playing with it all morning and for months I have had this spin button in use and it would only run once when the button was held it down. But It works great now! Thanks for your response.
 
Upvote 0

Forum statistics

Threads
1,215,018
Messages
6,122,703
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top