+ Reply to Thread
Results 1 to 5 of 5

Button who activates a macro

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    Bucharest
    MS-Off Ver
    Excel 2010
    Posts
    48

    Button who activates a macro

    Hello
    First i want to tell me how i write the code here, because I saw that you put into some kind of window.
    The I have a module which it's a macro who is actually an amount of macros.
    I want to put a button somewhere in sheet 1 or sheet 2 that activate this macro.
    The macro looks like this:

    Sub Main()
    Call muta
    Call Spatii
    Call Precuratat
    Call Sortat
    Call Curatat
    Call OneCell
    Call OneCell2
    End Sub
    If there are problems I'll return with other explanations
    Thank you!

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Button who activates a macro

    http://office.microsoft.com/en-us/ex...010236676.aspx
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    11-05-2012
    Location
    Bucharest
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Button who activates a macro

    Doesn't work. It appears an error, something like the sub procedure is not defined.
    When i put one macro works just fine, but when I put another one under the first one, appears this error.
    Another problem. My button is in sheet 2 and the text is in sheet 1.
    This is my button and "muta" and Spatii" are the 2 macros:

    Private Sub CommandButton1_Click()
    Worksheets("sheet1").Activate
    muta
    Spatii
    End Sub

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Button who activates a macro

    Try
    Please Login or Register  to view this content.
    if problems attach a sample file
    Last edited by patel45; 11-20-2012 at 07:22 AM.

  5. #5
    Registered User
    Join Date
    11-05-2012
    Location
    Bucharest
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Button who activates a macro

    I figure it out just before I saw your post
    I delete Private from one of the macros and now it works perfect
    Thank you for everything

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1