Undo button in the context menu (right click menu)

  • Thread starter Thread starter Madiya
  • Start date Start date
M

Madiya

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
 
hi Madiya

Try this

With Application.CommandBars("Cell")
.Controls.Add Type:=msoControlSplitDropdown, ID:=128, before:=1, temporary:=True
End With
 
128 is the id for undo button. Hope that helps

Sub BtnInRightClick()
Application.CommandBars("cell").Controls.Add , 128
End Sub
 
hi Madiya

Try this

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

--

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






- 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.
 
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


hi Madiya

Try this

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

--

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






- 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.
 
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








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
 
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
 
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, before:=1, temporary:=True
End With


--

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


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
 
Back
Top