+ Reply to Thread
Results 1 to 17 of 17

macro from sheet1, executing macro from sheet 2 and 3

  1. #1
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    167

    macro from sheet1, executing macro from sheet 2 and 3

    Hi,

    basicly, on sheet 1 i have this macro. I want that it execute the macro on sheet number 2 and number 3...but it doesnt work..

    Please Login or Register  to view this content.
    Last edited by extremis; 05-01-2013 at 03:23 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: macro from sheet1, executing macro from sheet 2 and 3

    Delete the private prefix to the other subs
    Elegant Simplicity............. Not Always

  3. #3
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    167

    Re: macro from sheet1, executing macro from sheet 2 and 3

    Private prefix to the other subs..sorry I am learning right now, could you show me what do you imply?

  4. #4
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    167

    Re: macro from sheet1, executing macro from sheet 2 and 3

    you mean the sheet("sheet2") ??

    so it should like that?

    Please Login or Register  to view this content.
    Well...it doesnt work...and both FilterCHISETUPPPLAPOC and refresh macro work. I tested them
    Last edited by extremis; 05-01-2013 at 02:16 PM.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: macro from sheet1, executing macro from sheet 2 and 3

    Maybe:

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    167

    Re: macro from sheet1, executing macro from sheet 2 and 3

    Nope......nice try tough ...

    the macro seem to stay on sheet 1...for some reason..-_-

  7. #7
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: macro from sheet1, executing macro from sheet 2 and 3

    On the other sheets the subs will usually by preceded by Private ... e.g. Private Sub Extremis()
    I think if you delete the private element you can call them from other sheets. e.g. Sub Extremis()

    If that doesn't work you'll have to move the other subs into a code module and the first line of code for each will need to activate the relevant sheet.
    Last edited by AndyLitch; 05-01-2013 at 02:31 PM.

  8. #8
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    167

    Re: macro from sheet1, executing macro from sheet 2 and 3

    Not on private mode..already

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: macro from sheet1, executing macro from sheet 2 and 3

    Quote Originally Posted by extremis View Post
    Nope......nice try tough ...

    the macro seem to stay on sheet 1...for some reason..-_-
    Is the code you mention on Sheet1 Event Code for Sheet1? If possible can you post the code you have?

  10. #10
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    167

    Re: macro from sheet1, executing macro from sheet 2 and 3

    alright...on sheet1

    Please Login or Register  to view this content.
    on sheet2

    Please Login or Register  to view this content.

    on sheet3

    Please Login or Register  to view this content.
    Last edited by extremis; 05-01-2013 at 02:37 PM.

  11. #11
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    167

    Re: macro from sheet1, executing macro from sheet 2 and 3

    So, what do you think? macro on sheet 2 and 3 work. I tested the macros...

  12. #12
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: macro from sheet1, executing macro from sheet 2 and 3

    sheet1 macro calls the other 2.............
    So you should only need to call the sheet 1 macro

  13. #13
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: macro from sheet1, executing macro from sheet 2 and 3

    Is your code in the Sheet Module or a Standard Module? I think you want your code in a Standard Module. Go to your VBA Editor and Insert a Module. Copy and paste the above code there. Then try to call it.

  14. #14
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    167

    Re: macro from sheet1, executing macro from sheet 2 and 3

    ok it work...

    explain me that PLEASE....how to put it on a module it just make it work?

  15. #15
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: macro from sheet1, executing macro from sheet 2 and 3

    Here is a great on-line course about macros from microsoft. It has a section explaining how to insert a standard module and place your macros there.

    http://office.microsoft.com/en-us/tr...22986&client=1

  16. #16
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    167

    Re: macro from sheet1, executing macro from sheet 2 and 3

    you know where i can find more of thoses course? I would like to teach myself VBA.

    pretty useful

  17. #17
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: macro from sheet1, executing macro from sheet 2 and 3

    Sure there is a wealth of information on the internet about free online courses. Just Google VBA. Also this website is very helpful.

+ 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