ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Undo button in the context menu (right click menu) (https://www.excelbanter.com/excel-programming/408214-undo-button-context-menu-right-click-menu.html)

Madiya

Undo button in the context menu (right click menu)
 
I have added some buttons for running my macro in the right click
context menu.
I want to add UNDO button also.
Pl help on how to proceed.

Regards,
Madiya

Ron de Bruin

Undo button in the context menu (right click menu)
 
hi Madiya

Try this

With Application.CommandBars("Cell")
.Controls.Add Type:=msoControlSplitDropdown, ID:=128, befo=1, temporary:=True
End With


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Madiya" wrote in message ...
I have added some buttons for running my macro in the right click
context menu.
I want to add UNDO button also.
Pl help on how to proceed.

Regards,
Madiya


Anant Basant

Undo button in the context menu (right click menu)
 
128 is the id for undo button. Hope that helps

Sub BtnInRightClick()
Application.CommandBars("cell").Controls.Add , 128
End Sub
--
Regards,
Anant


"Madiya" wrote:

I have added some buttons for running my macro in the right click
context menu.
I want to add UNDO button also.
Pl help on how to proceed.

Regards,
Madiya


Madiya

Undo button in the context menu (right click menu)
 
On Mar 24, 6:28*pm, "Ron de Bruin" wrote:
hi Madiya

Try this

* * With Application.CommandBars("Cell")
* * * * .Controls.Add Type:=msoControlSplitDropdown, ID:=128, befo=1, temporary:=True
* * End With

--

Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm



"Madiya" wrote in ...
I have added some buttons for running my macro in the right click
context menu.
I want to add UNDO button also.
Pl help on how to proceed.


Regards,
Madiya- Hide quoted text -


- Show quoted text -


Hi Ron,
Its great. Exactly what I want. Thank you.

However, for purpose of learning, I would like to know how to fig it
out?
Say if next time I want redo or sort asc or autosum or format painter?

I would like to do it myself as far as possible.

Pl let me know if possible.

Regards,
Madiya.

Ron de Bruin

Undo button in the context menu (right click menu)
 
Hi Madiya

See
http://www.rondebruin.nl/menuid.htm#Screenshots

Use the add-in to find the Id numbers

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Madiya" wrote in message ...
On Mar 24, 6:28 pm, "Ron de Bruin" wrote:
hi Madiya

Try this

With Application.CommandBars("Cell")
.Controls.Add Type:=msoControlSplitDropdown, ID:=128, befo=1, temporary:=True
End With

--

Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm



"Madiya" wrote in ...
I have added some buttons for running my macro in the right click
context menu.
I want to add UNDO button also.
Pl help on how to proceed.


Regards,
Madiya- Hide quoted text -


- Show quoted text -


Hi Ron,
Its great. Exactly what I want. Thank you.

However, for purpose of learning, I would like to know how to fig it
out?
Say if next time I want redo or sort asc or autosum or format painter?

I would like to do it myself as far as possible.

Pl let me know if possible.

Regards,
Madiya.

Madiya

Undo button in the context menu (right click menu)
 
On Mar 24, 6:59*pm, "Ron de Bruin" wrote:
Hi Madiya

Seehttp://www.rondebruin.nl/menuid.htm#Screenshots

Use the add-in to find the Id numbers

--

Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm

"Madiya" wrote in ...

On Mar 24, 6:28 pm, "Ron de Bruin" wrote:





hi Madiya


Try this


With Application.CommandBars("Cell")
.Controls.Add Type:=msoControlSplitDropdown, ID:=128, befo=1, temporary:=True
End With


--


Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm


"Madiya" wrote in ...
I have added some buttons for running my macro in the right click
context menu.
I want to add UNDO button also.
Pl help on how to proceed.


Regards,
Madiya- Hide quoted text -


- Show quoted text -


Hi Ron,
Its great. Exactly what I want. Thank you.

However, for purpose of learning, I would like to know how to fig it
out?
Say if next time I want redo or sort asc or autosum or format painter?

I would like to do it myself as far as possible.

Pl let me know if possible.

Regards,
Madiya.- Hide quoted text -

- Show quoted text -


Thank you Ron.
Anant,
Thanks.

Regards,
Madiya

Madiya

Undo button in the context menu (right click menu)
 
On Mar 24, 7:50*pm, Madiya wrote:
On Mar 24, 6:59*pm, "Ron de Bruin" wrote:





Hi Madiya


Seehttp://www.rondebruin.nl/menuid.htm#Screenshots


Use the add-in to find the Id numbers


--


Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm


"Madiya" wrote in ...


On Mar 24, 6:28 pm, "Ron de Bruin" wrote:


hi Madiya


Try this


With Application.CommandBars("Cell")
.Controls.Add Type:=msoControlSplitDropdown, ID:=128, befo=1, temporary:=True
End With


--


Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm


"Madiya" wrote in ...
I have added some buttons for running my macro in the right click
context menu.
I want to add UNDO button also.
Pl help on how to proceed.


Regards,
Madiya- Hide quoted text -


- Show quoted text -


Hi Ron,
Its great. Exactly what I want. Thank you.


However, for purpose of learning, I would like to know how to fig it
out?
Say if next time I want redo or sort asc or autosum or format painter?


I would like to do it myself as far as possible.


Pl let me know if possible.


Regards,
Madiya.- Hide quoted text -


- Show quoted text -


Thank you Ron.
Anant,
Thanks.

Regards,
Madiya- Hide quoted text -

- Show quoted text -


Hi Ron,
I have tried to add other buttons like save whose id is 3 but i am
getting following error.
Automation error
Unspecifies error
Both the errors are shown on the same error message.
Whats wrong? pl help.

Regards,
Madiya

Ron de Bruin

Undo button in the context menu (right click menu)
 
See that I use
msoControlSplitDropdown

Look in the add-in for the correct name

You must use

With Application.CommandBars("Cell")
.Controls.Add Type:=msoControlButton, ID:=3, befo=1, temporary:=True
End With


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Madiya" wrote in message ...
On Mar 24, 7:50 pm, Madiya wrote:
On Mar 24, 6:59 pm, "Ron de Bruin" wrote:





Hi Madiya


Seehttp://www.rondebruin.nl/menuid.htm#Screenshots


Use the add-in to find the Id numbers


--


Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm


"Madiya" wrote in ...


On Mar 24, 6:28 pm, "Ron de Bruin" wrote:


hi Madiya


Try this


With Application.CommandBars("Cell")
.Controls.Add Type:=msoControlSplitDropdown, ID:=128, befo=1, temporary:=True
End With


--


Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm


"Madiya" wrote in ...
I have added some buttons for running my macro in the right click
context menu.
I want to add UNDO button also.
Pl help on how to proceed.


Regards,
Madiya- Hide quoted text -


- Show quoted text -


Hi Ron,
Its great. Exactly what I want. Thank you.


However, for purpose of learning, I would like to know how to fig it
out?
Say if next time I want redo or sort asc or autosum or format painter?


I would like to do it myself as far as possible.


Pl let me know if possible.


Regards,
Madiya.- Hide quoted text -


- Show quoted text -


Thank you Ron.
Anant,
Thanks.

Regards,
Madiya- Hide quoted text -

- Show quoted text -


Hi Ron,
I have tried to add other buttons like save whose id is 3 but i am
getting following error.
Automation error
Unspecifies error
Both the errors are shown on the same error message.
Whats wrong? pl help.

Regards,
Madiya


All times are GMT +1. The time now is 02:22 AM.

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