ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how can i isert a funtion in F1 or F2? Like F1 put DEP in a space (https://www.excelbanter.com/excel-programming/385216-how-can-i-isert-funtion-f1-f2-like-f1-put-dep-space.html)

steven

how can i isert a funtion in F1 or F2? Like F1 put DEP in a space
 
help me.. can i program keyboard F1, F2 etc with word to put in exel???

Gary Brown

how can i isert a funtion in F1 or F2? Like F1 put DEP in a space
 
'/-------------------------------------------------------/
'Purpose of Macro:
'assign new Action to the Function F2 key
'not case sensitive - F2 Function key

sub AssignKey_F2( )
Application.OnKey "{f2}", "Example_F2"
end sub
'/-------------------------------------------------------/
'Purpose of Macro:
'performs desired action for F2 key

sub Example_F2( )
activecell.value = "DEP"
end sub
'/-------------------------------------------------------/
'Purpose of Macro:
'set F2 key back to default

sub AssignKeysBack2Default( )
Application.OnKey "{f2}"
end sub
'/-------------------------------------------------------/

--
HTH,
Gary Brown

If this post was helpful to you, please select ''YES'' at the bottom of the
post.



"Steven" wrote:

help me.. can i program keyboard F1, F2 etc with word to put in exel???



All times are GMT +1. The time now is 07:26 PM.

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