Spinner Jumps values

bydesign

Board Regular
Joined
Nov 29, 2003
Messages
184
Hello all

I have a spinner control that updates a textbox and calls a few subs from the spinner change event.

The problem is intermittent ... sometimes I can click one and the value will change by 1... other times it jumps 2 or 3... :oops:

I've tried different computers / mouses / people... all with the same results.

How would I limit a click to a value change of 1 while still maintaining the ability to hold down the mouse button for fast scrolling?

The code below is what I have... I've tried "DoEvents" between calls... no change in results...

spnPath_Change()

txtPath.text = spnPath.Value

Call Display_Path

Call Refresh_Form

end sub
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi, its unclear what you are scrolling through. Do you have SpinUp and SpinDown events as well? Perhaps it has something to do your called prcoedures - please post these.
 
Upvote 0
Parry, that's a significant amout of code to post... so I'll just give you the gist

spnPath_Change()

txtPath.text = spnPath.Value

Call Display_Path

Call Refresh_Form

end sub


txtPath.text is just a text box to display the spnPath.value

Dispaly path looks through all the sheets checking criteria... if it matches, the sheet is displayed

Refresh Form updates the userform based on the excel sheet that is now displayed... and enables, disables options based on sheet data


I have only used the change event... no others

I've also tried moving the code to the mouse up event

I suspect your thinking the same as me... something in one of the called events is causeing the problem... I've stepped through several times and I have not found what ever it is...

Since I can't find the actual problem, I'm going down the work around road... Thinking about a way to limit the value change by 1 unless the button is held down for 3 seconds??? I'm not sure how to approach this...

Thanks for your time.
 
Upvote 0
Im not sure what to suggest. I would change a few things in the refresh procedure as the way it repaints the form may make a difference. Perhaps you are clicking the buton before the search has completed and thats causing this. It may be better to have a command button that calls the procedures based on the spin value. An extra step for the user but it may avoid this problem.
 
Upvote 0

Forum statistics

Threads
1,203,326
Messages
6,054,743
Members
444,748
Latest member
knowak87

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