Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can VBA hook onto function keys???
Suppose I have a string value in Cell A1..... Can I somehow
associate the data in cell A1 with the F1 function key??? Ideally, I would like to be able to switch to other applications and just use the function keys to grab data out of Excel and paste the data into other apps using just the function keys. Thank you everyone for all your tips! Robert |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can VBA hook onto function keys???
Robert Crandal wrote:
Suppose I have a string value in Cell A1..... Can I somehow associate the data in cell A1 with the F1 function key??? Ideally, I would like to be able to switch to other applications and just use the function keys to grab data out of Excel and paste the data into other apps using just the function keys. Thank you everyone for all your tips! Robert Yes and no. You can trap the F1 key to do whatever you like /in Excel/ but other applications will do whatever F1 does there. To your point though, you could do something like this. In a workbook's ThisWorkbook module, place: Private Sub Workbook_Activate() Application.OnKey "{F1}", "CopyValueToClipboard" End Sub And in a standard module place (*) Sub CopyValueToClipboard() Dim DataObj As New MSForms.Dataobject DataObj.SetText ActiveSheet.Range("A1").Value DataObj.PutInClipboard End Sub The first procedure tells Excel to fire "CopyValueToClipboard" when F1 is pressed (pressed within Excel that is). The second procedure places the value from A1 on the clipboard. You can now switch to another application and paste. (*) as seen on Chip Pearson's site: http://www.cpearson.com/excel/Clipboard.aspx |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Change the Function Keys | Excel Discussion (Misc queries) | |||
Enable Function keys | Excel Discussion (Misc queries) | |||
Getting a hook on Toolbar Events | Excel Programming | |||
hook into worksheet events temporarily? | Excel Programming | |||
Using function keys in macros | Excel Programming |