ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Pre-programming keys (https://www.excelbanter.com/excel-discussion-misc-queries/230985-pre-programming-keys.html)

Bill Ridgeway

Pre-programming keys
 
In some spreadsheets I need to enter a phrase in many cells. Is it possible
to pre-program the function keys with a phrase so it may be inserted into a
spreadsheet at the push of that key. If so, how can it be done?

Thanks.

Bill Ridgeway



Don Guillett

Pre-programming keys
 
How about a nice custom menu toolbar

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bill Ridgeway" wrote in message
...
In some spreadsheets I need to enter a phrase in many cells. Is it
possible to pre-program the function keys with a phrase so it may be
inserted into a spreadsheet at the push of that key. If so, how can it be
done?

Thanks.

Bill Ridgeway



Harlan Grove[_2_]

Pre-programming keys
 
"Don Guillett" wrote...
How about a nice custom menu toolbar

....

Not so simple in Excel 2007.

To answer the OP's question, it can be done for entire cell entries
from READY mode, but not in ENTER, POINT or EDIT modes. It involves
convoluted macros like


Sub foobar() 'set keystroke macros
Application.OnKey "+^{F1}", "foobar1"
Application.OnKey "+^{F2}", "foobar2"
End Sub


Sub unfoobar() 'clear keystroke macros
Application.OnKey "+^{F1}"
Application.OnKey "+^{F2}"
End Sub


Private Sub foobar1() 'one macro
ActiveCell.Value2 = "foo"
End Sub


Private Sub foobar2() 'another macro
ActiveCell.Value2 = "bar"
End Sub


Much. much, much better to use a general macro utility like AutoIt to
do this.

Don Guillett

Pre-programming keys
 

Didn't m$ withdraw that version?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Harlan Grove" wrote in message
...
"Don Guillett" wrote...
How about a nice custom menu toolbar

...

Not so simple in Excel 2007.

To answer the OP's question, it can be done for entire cell entries
from READY mode, but not in ENTER, POINT or EDIT modes. It involves
convoluted macros like


Sub foobar() 'set keystroke macros
Application.OnKey "+^{F1}", "foobar1"
Application.OnKey "+^{F2}", "foobar2"
End Sub


Sub unfoobar() 'clear keystroke macros
Application.OnKey "+^{F1}"
Application.OnKey "+^{F2}"
End Sub


Private Sub foobar1() 'one macro
ActiveCell.Value2 = "foo"
End Sub


Private Sub foobar2() 'another macro
ActiveCell.Value2 = "bar"
End Sub


Much. much, much better to use a general macro utility like AutoIt to
do this.



Ed from AZ

Pre-programming keys
 
On May 15, 11:33*am, "Bill Ridgeway" wrote:
In some spreadsheets I need to enter a phrase in many cells. *Is it possible
to pre-program the function keys with a phrase so it may be inserted into a
spreadsheet at the push of that key. *If so, how can it be done?

Thanks.

Bill Ridgeway


Does it have to be the function keys? Why not record a regular macro
and assign it to a keystroke? Or even put it up on the QAT?

Ed

Bill Ridgeway

Pre-programming keys
 
"Ed from AZ" wrote in message
...
On May 15, 11:33 am, "Bill Ridgeway" wrote:
In some spreadsheets I need to enter a phrase in many cells. Is it
possible
to pre-program the function keys with a phrase so it may be inserted into
a
spreadsheet at the push of that key. If so, how can it be done?

Thanks.

Bill Ridgeway


Does it have to be the function keys? Why not record a regular macro
and assign it to a keystroke? Or even put it up on the QAT?

Ed

Thanks Ed.
No. It doesn't have to be function keys. Just thought they are the least
used keys and wouldn't cause a conflict if used for my purpose. What's the
QAT?

Bill Ridgeway



Ed from AZ

Pre-programming keys
 
What's the QAT?

In XL 2007, it's the Quick Access Toolbar. When MS introduced the
ribbon, they eliminated all the standard toolbars that we could
customize with macros and frequently used commands. Now the best you
can do is add it to the QAT.

Ed

ebloch

Pre-programming keys
 
Look at the free or paid versions of ShortKeys at http://www.shortkeys.com/

Useable in almost any program.

Eric


"Bill Ridgeway" wrote in message
...
In some spreadsheets I need to enter a phrase in many cells. Is it
possible to pre-program the function keys with a phrase so it may be
inserted into a spreadsheet at the push of that key. If so, how can it be
done?

Thanks.

Bill Ridgeway





All times are GMT +1. The time now is 04:48 PM.

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