K
keithb
What am I missing? This code is in the "ThisWorkbook" Module; however it
does not execute ShiftLeft and ShiftRight when the designated keys are
pressed.
Private Sub App_WorkbookOpen(ByVal Wb As Workbook)
Application.OnKey "%{LEFT}", "ShiftLeft"
Application.OnKey "%{RIGHT}", "ShiftRight"
End Sub
Sub ShiftLeft()
With Selection
If (.IndentLevel > 0) Then
.InsertIndent -1
Else
Beep
End If
End With
End Sub
Sub ShiftRight()
With Selection
If (.IndentLevel < 15) Then
.InsertIndent 1
Else
Beep
End If
End With
End Sub
does not execute ShiftLeft and ShiftRight when the designated keys are
pressed.
Private Sub App_WorkbookOpen(ByVal Wb As Workbook)
Application.OnKey "%{LEFT}", "ShiftLeft"
Application.OnKey "%{RIGHT}", "ShiftRight"
End Sub
Sub ShiftLeft()
With Selection
If (.IndentLevel > 0) Then
.InsertIndent -1
Else
Beep
End If
End With
End Sub
Sub ShiftRight()
With Selection
If (.IndentLevel < 15) Then
.InsertIndent 1
Else
Beep
End If
End With
End Sub