Activate Spin Buttons with Keys

D

Donny

Pretty Simple I think, I'm just learning VBA. I want to be able to
control two different spin buttons with 4 different keys. (ex. i key is
up, k key is down on one spin button, j key is left and L key is right
on the other spin button. I already have some code written for these
buttons, I would just like to hit a key rather than clicking the
buttons. Also, I want to be able to hold down the key just like
clicking and holding.
 
H

halimnurikhwan

Hi Donny,

'try this :
Sub getStarted()
Application.OnKey "j", "SpinDown"
End Sub

'your code goes here
Sub SpinDown()
ActiveCell.Offset(1, 0).Activate
End Sub

'to end "j" onkey
Sub getTidy()
Application.OnKey "j"
End Sub

Rgds,

Halim


Donny menuliskan:
 

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