Create Button in Excel Menu for Macro

  • Hello There


    I am trying to make this code works by Toggle botten in Mymenu.
    when i press the toggle bottun the copy takes place, then move the curser to distenation and press the Toggle again to past only the comment.


    How to make the Toggle bottun inside Mymenu (A menu in the Worsheet Menu Bar).


    Code
    Sub Macro1()
    '    Selection.Copy
        Selection.PasteSpecial Paste:=xlPasteComments, Operation:=xlNone, _
            SkipBlanks:=False, Transpose:=False
        Application.CutCopyMode = False
    End Sub

    ******************
    [SIZE=6]Yours
    h [/SIZE]

    Your Help Is Highly Appreciated

  • Re: Create Button in Excel Menu for Macro


    Thank you, but I need to know how to creat a toggle bottun inside this Menu, what the link shows is how to creat a macro inside menu.


    any idea ?

    ******************
    [SIZE=6]Yours
    h [/SIZE]

    Your Help Is Highly Appreciated

  • Re: Create Button in Excel Menu for Macro


    So you want one button to perform two different actions?


    Hmm, well a button can only trigger one macro as far as I know, so your macro would need to use a global boolean variable which is set to ON when you click the button the first time and set it to OFF when you click the button the second time. The Macro would then branch and perform the relevant code depending on the value of global variable.


    Ger

    _______________________________________________
    There are 10 types of people in the world. Those that understand Binary and those that dont. :P


    Why are Halloween and Christmas the same? Because Oct 31 = Dec 25... ;)

    _______________________________________________

  • Re: Create Button in Excel Menu for Macro


    yes, this is what i need. but inside Mymenu ?

    ******************
    [SIZE=6]Yours
    h [/SIZE]

    Your Help Is Highly Appreciated

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!