close

Hi everyone,

I wonder how to assign certain hotkeys in order to enter a predefined
text.
What I want to do is:
Press F2 to enter the text quot;helloquot;
F3 enters quot;gooddayquot;
F5 enters quot;see youquot;
CTRL K enters quot;good luckquot;
and so on ...

Thanks in advance for your help
texter--
texter
------------------------------------------------------------------------
texter's Profile: www.excelforum.com/member.php...oamp;userid=32290
View this thread: www.excelforum.com/showthread...hreadid=520435texter wrote:
gt; Hi everyone,
gt;
gt; I wonder how to assign certain hotkeys in order to enter a predefined
gt; text.
gt; What I want to do is:
gt; Press F2 to enter the text quot;helloquot;
gt; F3 enters quot;gooddayquot;
gt; F5 enters quot;see youquot;
gt; CTRL K enters quot;good luckquot;
gt; and so on ...
gt;
gt; Thanks in advance for your help
gt; texter
gt;
gt;
You might want to check out this freebie:

www.phraseexpress.com/

gls858

The following reassigns macros to the 3 function keys:

Sub turnOnF2()
Application.OnKey quot;{F2}quot;, quot;HelloMacroquot;
End Sub

Sub turnOnF3()
Application.OnKey quot;{F3}quot;, quot;GoodDayMacroquot;
End Sub

Sub turnOnF5()
Application.OnKey quot;{F5}quot;, quot;SeeYouMacroquot;
End Sub

=============================================

The following are the actual macros themselves that enter the text:

Sub HelloMacro()
ActiveCell.Formula = quot;Helloquot;
End Sub

Sub GoodDayMacro()
ActiveCell.Formula = quot;Good Dayquot;
End Sub

Sub SeeYouMacro()
ActiveCell.Formula = quot;See Youquot;
End Sub

=============================================

The following allows you to return the function keys to their
original state:

Sub turnOffF2()
Application.OnKey quot;{F2}quot;
End Sub

Sub turnOffF3()
Application.OnKey quot;{F3}quot;
End Sub

Sub turnOffF5()
Application.OnKey quot;{F5}quot;
End Sub

=============================================

Type this macro in the VBE, then exit the VBE back to the worksheet
screen.Sub GoodLuckMacro()
ActiveCell.Formula = quot;See Youquot;
End SubNow do the menu sequence Toolsgt;Macrogt;Macros, and find the macro
in the list. Click it just once just to highlight it. Click the
Options button.
Enter a lowercase quot;kquot; for the shortcut key. This assigns Ctrl K as the
shortcut key to enter the text quot;See Youquot;. (If you enter an uppercase
quot;Kquot;, then Ctrl Shift K becomes the shortcut key.)I hope this helps you.Oops! correction to that last macro - should read:

Sub GoodLuckMacro()
ActiveCell.Formula = quot;Good Luckquot;
End Sub

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()