Activate Spin Buttons with Keys

  • Thread starter Thread starter Donny
  • Start date Start date
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.
 
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:
 
Back
Top