ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding items to a right click menu (https://www.excelbanter.com/excel-programming/361997-adding-items-right-click-menu.html)

Kezza

Adding items to a right click menu
 
Hello all, is it possible to add "insert time" and "insert date" to the
right click popup menu? I am trying to get away from keyboard
shortcuts.
TIA
Kezza


Norman Jones

Adding items to a right click menu
 
Hi Kezza,

Hello all, is it possible to add "insert time" and "insert date" to the
right click popup menu? I am trying to get away from keyboard
shortcuts.


Ron de Bruin has sample code for adding (or removing) commands to the
right-click menu at:

http://www.rondebruin.com/menuid.htm#Add

See particularly Ron's Add_Controls procedure on that page.

In your case, the macros to be added to the menu might be:

'=============
Public Sub InsertDate()
Selection.Value = Date
End Sub

'-----------------

Public Sub InsertTime()
Selection.Value = Time
End Sub
'<<=============


---
Regards,
Norman



Kezza

Adding items to a right click menu
 
Thanks heaps for your help.
Kind Regards
Kezza


Stefano Gatto

Adding items to a right click menu
 
Maybe this helps: Ctrl-: and Ctrl-; are keyboard shortcuts inserting time and
date resp in Excel.
--
Stefano Gatto


"Kezza" wrote:

Thanks heaps for your help.
Kind Regards
Kezza




All times are GMT +1. The time now is 01:52 PM.

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