the application.onkey worked before creating it as an add-in now the only way the command will work is if I go into VBA project screen and run the sub. How do I get it to run without running the a sub in VBA projects.
--------- code "this workbook"
Option Explicit
Public Sub Workbook_Activate()
Application.OnKey "^+s", "Autofilter"
End Sub
Public Sub Workbook_Deactivate()
Application.OnKey "^+s"
End Sub
-------- code "Module 1"
Option Explicit
Public Sub Autofilter()
Dim FinalRow As Long
Dim FinalColumn As Long
Dim PRange As Range
Application.OnKey "^+s", "Autofilter"
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("A" & FinalRow).Autofilter
End Sub
--------- code "this workbook"
Option Explicit
Public Sub Workbook_Activate()
Application.OnKey "^+s", "Autofilter"
End Sub
Public Sub Workbook_Deactivate()
Application.OnKey "^+s"
End Sub
-------- code "Module 1"
Option Explicit
Public Sub Autofilter()
Dim FinalRow As Long
Dim FinalColumn As Long
Dim PRange As Range
Application.OnKey "^+s", "Autofilter"
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("A" & FinalRow).Autofilter
End Sub