Undo button in the context menu (right click menu)

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
 
R

Ron de Bruin

hi Madiya

Try this

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

Anant Basant

128 is the id for undo button. Hope that helps

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

Madiya

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

Ron de Bruin

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

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
 
M

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
 
R

Ron de Bruin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top