ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   OnKey for Alt f not overriding standard use of Alt-F (https://www.excelbanter.com/excel-programming/278808-onkey-alt-f-not-overriding-standard-use-alt-f.html)

Tim Richardson[_2_]

OnKey for Alt f not overriding standard use of Alt-F
 
I want to use Alt F for something (toggle 'freeze panes').
I have this code in my personal.xls 'thisWorkbook' object module:

Private Sub Workbook_Open()
Set X.XL = Application
Application.OnKey "^+5", "applyFormatPercent"
'the macro procedure must be in a normal module. I use AppEvents
Application.OnKey "%f", "toggleFreezePanes"
End Sub


The first remapping, "applyFormatPercent" works fine (this gives me %
with one decimal point).

The second is not working. Alt-f always gives me the file menu.

The macro toggleFreezePanes works fine.

I also tried
Application.OnKey "%+f", "toggleFreezePanes" but I have the same
result.


Any ideas?

regards,

Tim

John Green[_2_]

OnKey for Alt f not overriding standard use of Alt-F
 
Tim,

Apart from disabling the worksheet menu bar (CommandBars(1).Enabled=False), I don't know an easy way to override Alt+f. I suggest
you use Ctrl+Alt+f ("^%f")

--

John Green - Excel MVP
Sydney
Australia


"Tim Richardson" wrote in message om...
I want to use Alt F for something (toggle 'freeze panes').
I have this code in my personal.xls 'thisWorkbook' object module:

Private Sub Workbook_Open()
Set X.XL = Application
Application.OnKey "^+5", "applyFormatPercent"
'the macro procedure must be in a normal module. I use AppEvents
Application.OnKey "%f", "toggleFreezePanes"
End Sub


The first remapping, "applyFormatPercent" works fine (this gives me %
with one decimal point).

The second is not working. Alt-f always gives me the file menu.

The macro toggleFreezePanes works fine.

I also tried
Application.OnKey "%+f", "toggleFreezePanes" but I have the same
result.


Any ideas?

regards,

Tim





All times are GMT +1. The time now is 11:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com