J
Joyce
Hi,
I have controls on my worksheet and have code that moves from one control to
another. That works fine.
I would like to jump from one control to a cell address, but the following
doesn't seem to work. Any suggestions would be greatly appreciated!
Private Sub GroupBox10_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
Dim bBackwards As Boolean
Const ctlPrev As String = "ComboBox2"
Select Case KeyCode
Case vbKeyTab, vbKeyReturn, vbKeyDown, vbKeyUp
Application.ScreenUpdating = False
'Determine forwards or backwards
bBackwards = CBool(Shift)
'Activate the appropriate control based on key(s) pressed
If bBackwards Then
ActiveSheet.OLEObjects(ctlPrev).Activate
Else
Range("D20").Activate
End If
Application.ScreenUpdating = True
End Select
End Sub
I have controls on my worksheet and have code that moves from one control to
another. That works fine.
I would like to jump from one control to a cell address, but the following
doesn't seem to work. Any suggestions would be greatly appreciated!
Private Sub GroupBox10_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
Dim bBackwards As Boolean
Const ctlPrev As String = "ComboBox2"
Select Case KeyCode
Case vbKeyTab, vbKeyReturn, vbKeyDown, vbKeyUp
Application.ScreenUpdating = False
'Determine forwards or backwards
bBackwards = CBool(Shift)
'Activate the appropriate control based on key(s) pressed
If bBackwards Then
ActiveSheet.OLEObjects(ctlPrev).Activate
Else
Range("D20").Activate
End If
Application.ScreenUpdating = True
End Select
End Sub