Hot Keys for colors

mbkogan2

New Member
Joined
Jul 3, 2019
Messages
2
Hi,

Is it possible to set custom hot keys for colors? For example, instead of Alt+H+H and then arrow keying to the color I want to select, is there a way to set Alt+H+H+1 to, say, white, and Alt+H+H+2 to black, Alt+H+H+3 to the third color in the palette, etc.?

Thanks!
 

Some videos you may like

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
3,066
.
You'll want to search for ONKEY. There are tons of examples on the internet and this Forum.

Here is an example for you to review :

Code:
Option Explicit




Private Sub Workbook_Open()


Application.OnKey "N", "NoFill"
Application.OnKey "r", "InsertRowandCopy"
Application.OnKey "t", "PBCandTextbox"
Application.OnKey "y", "YellowHighlight"




End Sub
The above macro is located in the ThisWorkbook Module. When the WB is opened the OnKey commands are initialized and reference the various macros located in
regular module / s.

This example shows a single key press for running the macro. You can edit the code to utilize multi-key presses as you indicated in your post.

Here is a link to download the workbook. Study it ... along with researching the Internet for OnKey :

https://www.amazon.com/clouddrive/share/DHDidJdUngSAhMeZixouEPQxE0nLrxMJpCaghUTGsFC
 

mbkogan2

New Member
Joined
Jul 3, 2019
Messages
2
Is there a way to do it without macros / VBA?



.
You'll want to search for ONKEY. There are tons of examples on the internet and this Forum.

Here is an example for you to review :

Code:
Option Explicit




Private Sub Workbook_Open()


Application.OnKey "N", "NoFill"
Application.OnKey "r", "InsertRowandCopy"
Application.OnKey "t", "PBCandTextbox"
Application.OnKey "y", "YellowHighlight"




End Sub
The above macro is located in the ThisWorkbook Module. When the WB is opened the OnKey commands are initialized and reference the various macros located in
regular module / s.

This example shows a single key press for running the macro. You can edit the code to utilize multi-key presses as you indicated in your post.

Here is a link to download the workbook. Study it ... along with researching the Internet for OnKey :

https://www.amazon.com/clouddrive/share/DHDidJdUngSAhMeZixouEPQxE0nLrxMJpCaghUTGsFC
 

Watch MrExcel Video

Forum statistics

Threads
1,095,176
Messages
5,442,835
Members
405,201
Latest member
kashyap44

This Week's Hot Topics

  • Copy entire row if CountA <>0 to another sheet
    [B]I want to copy entire row if CountA <>0 for column J7:AM7 (headers on J6:AM6) and so on till the last used cell is column D and paste the...
  • Select last used Row in Table
    I have created a Table in a Worksheet which is locked to prevent user errors and protect formula. Some of the cells require freetext entries which...
  • excel workbook: do not allow certain file name
    Hello all, Don't think this has ever been asked before, but how do I restrict file save [Before_Save Event] if the name of the file being saved...
  • fixing problem autofilter
    hello i need help about my code when i search by code in textbox it doesn't show anything this is my data [ATTACH type="full"...
  • “Weight”
    Hi, i’ve got a long sheet filled with weights such as kg,g,L & ml. i can build a formula to convert kg into g and liter into ml. How ever, my...
  • How to capitalize everything before a certain character?
    In column A, I have some text: Hello good day.mp3 Hello good day.flac etc. I'd like to capitalize everything before the period. I don't need the...
Top