AlbyDangles
New Member
- Joined
- Dec 14, 2013
- Messages
- 6
I am running a macro by pressing the "s" key if the active cell is in column 3 and the row height is 31.5. That part is working OK.
My problem is I have to press the "s" key twice when a cell that is not in column 3 and the row height is 31.5 is selected.
Private Sub XL_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Application.OnKey "s", "Process_S_KeyEvent"
End Sub
Private Sub Process_S_KeyEvent()
If ActiveCell.Column = 3 And ActiveCell.RowHeight = 31.5 Then
MsgBox "Hello"
Exit Sub
Else
Application.OnKey "s" 'I think the problem is here
End If
End Sub
My problem is I have to press the "s" key twice when a cell that is not in column 3 and the row height is 31.5 is selected.
Private Sub XL_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Application.OnKey "s", "Process_S_KeyEvent"
End Sub
Private Sub Process_S_KeyEvent()
If ActiveCell.Column = 3 And ActiveCell.RowHeight = 31.5 Then
MsgBox "Hello"
Exit Sub
Else
Application.OnKey "s" 'I think the problem is here
End If
End Sub