Spin Box and Arrow Keys

eashtm01

New Member
Joined
Jun 18, 2022
Messages
17
Office Version
  1. 2016
Platform
  1. Windows
Hello, is there a way to use the arrow keys on the keypad to control the information in a spin box? Also, is there a way to record the highest/ lowest number reached in the box? For instance, I want to be able to increase and decrease the value but I want to keep a a running collection of the highest and lowest numbers reached. Thanks for any help.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
When I have a spin button that has focus, the up and and down arrow keys do change the values, doing nothing else special. What have you tried?

You need VBA to track the high- and low-water marks. It is advisable to track the actual values in cells so the information isn't lost if VBA resets, or the file closes and reopens.
 
Upvote 0
Thanks for the reply. For the keys, I’m asking if I can use the up and down keys on the physical keypad to raise and lower the value in a cell. Hope this clarifies. Thanks.
 
Upvote 0
That's exactly what happens when I create a spin button. I click the physical up and down arrows on the keyboard and the value goes up or down. The spin button simply needs to have focus.
 
Upvote 0
Oh, I'll have to research that. I don't know anything about "Focus". Thanks.
 
Upvote 0
A control has focus if it has been selected (clicked on). Then there is usually some sort of highlight or outline to indicate it has focus. If you have, for example, a worksheet with a textbox, you click on the textbox then you can start typing and the text goes into the textbox. If you have a spin button and click on the spin button, you can then use up and down arrows to continue to adjust the values.

Are you using a Forms spin button or an ActiveX spin button?
 
Upvote 0
Here is an example. A cell is selected. I use the arrows, and it changes cells. I click on the spin button, and it now has focus and the keyboard arrows change the value.

 
Upvote 0
That would have been helpful to know. I used an ActiveX spin button, but a Forms spin button won't do this. It will be easier to meet both of your requirements if you use an ActiveX control.
 
Upvote 0

Forum statistics

Threads
1,225,028
Messages
6,182,453
Members
453,113
Latest member
aes34894328

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