ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   shortcuts (https://www.excelbanter.com/excel-programming/354253-shortcuts.html)

Jason Zischke

shortcuts
 
Hi All

I was wondering if there is a way for the ability to press a letter and for
it to call a macro on a worksheet.

Jason



Norman Jones

shortcuts
 
Hi Jason,

See 'Run a macro from a keyboard shortcut' in Excel help.

---
Regards,
Norman


"Jason Zischke" wrote in message
...
Hi All

I was wondering if there is a way for the ability to press a letter and
for
it to call a macro on a worksheet.

Jason





Jason Zischke

shortcuts
 
Hi Norman Jones

Thanks for the quick responce, is there a way for macro to run without the
control button just the letter eg "r" runs macro1?

Jason

"Norman Jones" wrote:

Hi Jason,

See 'Run a macro from a keyboard shortcut' in Excel help.

---
Regards,
Norman


"Jason Zischke" wrote in message
...
Hi All

I was wondering if there is a way for the ability to press a letter and
for
it to call a macro on a worksheet.

Jason






David McRitchie

shortcuts
 
How would you distinguish between entering data and a single key shortcut.

If you have your cursor on a specific empty cell you could invoke a macro using
from a Change Event macro.
http://www.mvps.org/dmcritchie/excel/event.htm
we could help you with that, but I don't see much point unless you would not be
actually entering data into the sheet.

But if you did you might check that the location is $A$1 check the 1st letter
of the entry and if it matches your choice clear the cell and invoke the other macro
or incorporate it within your change macro. (VBA is case sensitive)
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Jason Zischke" wrote in message ...
Hi Norman Jones

Thanks for the quick responce, is there a way for macro to run without the
control button just the letter eg "r" runs macro1?

Jason

"Norman Jones" wrote:

Hi Jason,

See 'Run a macro from a keyboard shortcut' in Excel help.

---
Regards,
Norman


"Jason Zischke" wrote in message
...
Hi All

I was wondering if there is a way for the ability to press a letter and
for
it to call a macro on a worksheet.

Jason








Jason Zischke

shortcuts
 
Hey guys,

Don't worry about this one I worked it out I used :

Private Sub Worksheet_Activate()
Application.EditDirectlyInCell = False
Application.OnKey "{e}", "Module1.Macro1"
End Sub

to turn off the edit cell property and enable the shortcut and

Private Sub Worksheet_Deactivate()
Application.EditDirectlyInCell = True
End Sub

to turn on the edit cell property

Jason

"David McRitchie" wrote:

How would you distinguish between entering data and a single key shortcut.

If you have your cursor on a specific empty cell you could invoke a macro using
from a Change Event macro.
http://www.mvps.org/dmcritchie/excel/event.htm
we could help you with that, but I don't see much point unless you would not be
actually entering data into the sheet.

But if you did you might check that the location is $A$1 check the 1st letter
of the entry and if it matches your choice clear the cell and invoke the other macro
or incorporate it within your change macro. (VBA is case sensitive)
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Jason Zischke" wrote in message ...
Hi Norman Jones

Thanks for the quick responce, is there a way for macro to run without the
control button just the letter eg "r" runs macro1?

Jason

"Norman Jones" wrote:

Hi Jason,

See 'Run a macro from a keyboard shortcut' in Excel help.

---
Regards,
Norman


"Jason Zischke" wrote in message
...
Hi All

I was wondering if there is a way for the ability to press a letter and
for
it to call a macro on a worksheet.

Jason









damorrison

shortcuts
 
go to your list of macros, select the macro and then options, select
the shrtcut key that you want to use, it will end up being the ctrl key
and whatever letter you choose
Dave


David McRitchie

shortcuts
 
Hi Jason,
Very clever. The person can always use the location bar, but I was not
expecting that you would be able to enter data directly in the cell - except for
anything that would be with a lowercase "e" which is immediately caught
on the keystroke.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Jason Zischke" wrote in message ...
Hey guys,

Don't worry about this one I worked it out I used :

Private Sub Worksheet_Activate()
Application.EditDirectlyInCell = False
Application.OnKey "{e}", "Module1.Macro1"
End Sub

to turn off the edit cell property and enable the shortcut and

Private Sub Worksheet_Deactivate()
Application.EditDirectlyInCell = True
End Sub

to turn on the edit cell property

Jason

"David McRitchie" wrote:

How would you distinguish between entering data and a single key shortcut.

If you have your cursor on a specific empty cell you could invoke a macro using
from a Change Event macro.
http://www.mvps.org/dmcritchie/excel/event.htm
we could help you with that, but I don't see much point unless you would not be
actually entering data into the sheet.

But if you did you might check that the location is $A$1 check the 1st letter
of the entry and if it matches your choice clear the cell and invoke the other macro
or incorporate it within your change macro. (VBA is case sensitive)
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Jason Zischke" wrote in message

...
Hi Norman Jones

Thanks for the quick responce, is there a way for macro to run without the
control button just the letter eg "r" runs macro1?

Jason

"Norman Jones" wrote:

Hi Jason,

See 'Run a macro from a keyboard shortcut' in Excel help.

---
Regards,
Norman


"Jason Zischke" wrote in message
...
Hi All

I was wondering if there is a way for the ability to press a letter and
for
it to call a macro on a worksheet.

Jason











David McRitchie

shortcuts
 
Hi Jason,

missed something in your code upon deactivation, you will want to deactivate the
specific onkey that you assigned.

Private Sub Worksheet_Deactivate()
Application.EditDirectlyInCell = True
Application.OnKey "{e}"
End Sub



David McRitchie

shortcuts
 
sorry mixed up terms I meant you can always type cell content into the
"Formula Bar" in Excel if you need to begin cell content with a lowercase "e".

Gets confusing at times
Address Bar in Internet Explorer is in about the same location, but is called
Location Bar in Firefox.




All times are GMT +1. The time now is 12:30 PM.

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