use of arrow keys instead of typing in number

erickguz

Board Regular
Joined
May 11, 2010
Messages
58
Hi - I am graphing stocks. My charts are basic: O/H/L/C.

My starting point is designated in cell c1. For example, if I want to go back 100 days, I type in -100. If I want to go back 18 days, I type in -18.

In cell c1, is there any way in VBA that I can press the --> or <-- keys (arrow keys) to take me back one day? Instead of typing in -1, then -2, then -3, etc., I can simply press the back arrow key several times...

Thank you.
-Erick
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Why not use a spinbutton?

Not sure how I feel... I've been using excel for twenty years and never heard of this tool...

I installed the Form Control version, but receive an error message: there is not enough memory to complete this action... Any idea? Also, since I am not familiar with VBA, I haven't tried the ActiveX method. Would that help? My data updates every second; not sure if the api is the cause.
 
Upvote 0
Looks like you've tried what I was thinking of, linking a form control spinbutton to the cell where you normally enter your day offset (C1), with a min and max value set so that it covers the scope that you would need.

If you've linked the form control to anything vba based, or clicked it multiple times in quick succession then that could explain the error message, going quickly from -1 to -10 would mean that it has to reprocess everything 10 times, it will not skip straight to -10 once you stop clicking.

Beyond that, I have no idea what would cause the error, api's are not something I have experience with.
 
Upvote 0
Pretty sure it's just that the file is downloading multitudes of quotes and something's going on...

Regardless, I learned something that I could use on many other applications. Thank you for the response and the suggestion.

-Erick
 
Upvote 0
I did try the spinbutton with the activex and it works great. Thanks again. I've been wanting to do this for so long, thinking it was more complicated.
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,666
Members
448,977
Latest member
moonlight6

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