View Single Post
 
Old 04-26-2021, 03:11 AM
p45cal's Avatar
p45cal p45cal is offline Windows 10 Office 2019
Expert
 
Join Date: Apr 2014
Posts: 871
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Quote:
Originally Posted by rollis13 View Post
and assign it to a key combination.
Example: Ctrl+t (t for time )
The user interface dialogue box (Alt+F8 from the keyboard) Options… button only allows you to use letters, you can (since you're already using macros) assign the same key combination you're used to using (Ctrl+Shift+colon) to that macro with:
Code:
Application.OnKey "+^:", "Data"
You could run that one-liner on workbook open, or when you activate that sheet, with the likes of:
Code:
Private Sub Workbook_Open()
Application.OnKey "+^:", "Data"
End Sub
in the ThisWorkbook's code-module,
or in the sheet concerned's code-module:
Code:
Private Sub Worksheet_Activate()
Application.OnKey "+^:", "Data"
End Sub
It's polite to restore the original functionality when you no longer need it which you can do with the one liner:
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnKey "+^:"
End Sub
but for such a trivial change you probably don't want to bother; it'll be restored when you next open Excel anyway.
Reply With Quote