Re: assign onkey to 1 worksheet
- From: "Jake Marx" <msnews@xxxxxxxxxxxx>
- Date: Fri, 1 Jul 2005 07:45:49 -0700
Hi short_n_curly,
short_n_curly wrote:
marco recorder allows you to record an onkey macro suck as on key
CTRL+t execute procedure however i have a workbook with 80+
worksheets and only want the onkey command to work on certain sheets,
can this command be assigned into the code i any particular work***
if so how?
i know that the command is application.onkey "^{t}" for the above
onkey command but this does not seem to work when i enter it into vba
cose for a particular work*** please advise thanks
Not directly. But in the procedure you assign to Ctrl+t via OnKey, you can check the Active*** to see if it matches the *** you're targeting:
Sub startit()
Application.OnKey "^{t}", "test"
End SubSub test()
If ActiveSheet Is Sheet1 Then
MsgBox Active***.Name
End If
End SubSub endit()
Application.OnKey "^{t}"
End Sub-- Regards,
Jake Marx MS MVP - Excel www.longhead.com
[please keep replies in the newsgroup - email address unmonitored]
.
- References:
- assign onkey to 1 work***
- From: short_n_curly
- assign onkey to 1 work***
- Prev by Date: Re: xlVisibleCellsOnly Help to copy only Visible Cells/Rows
- Next by Date: Re: Calculation of row count
- Previous by thread: assign onkey to 1 work***
- Next by thread: Re: assign onkey to 1 work***
- Index(es):