+ Reply to Thread
Results 1 to 2 of 2

Running Two Macros

Hybrid View

  1. #1
    Registered User
    Join Date
    10-06-2011
    Location
    India, Chennai
    MS-Off Ver
    Excel 2003 (in Office) Excel 2007 (in Home)
    Posts
    21

    Running Two Macros

    Hi Friends,

    I want to create a Excel file which contains a button "RUN", when i click it, it should open the EXCEL x.xls and then it should execute two macros and atlast save the x.xls file and close it.


    Can any one please help me to create a script for the above needs.

    Thank you,

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Need Script - Running Two Macros

    Hi dineshsilicon, make your button and add a revised version (your procedures that you are wanting to call) to suit your needs.

    Private Sub CommandButton1_Click()
    
        Dim MyDir As String
        Dim strPath As String
        MyDir = ActiveWorkbook.Path
        strPath = MyDir & "\x.xls"
        Workbooks.Open Filename:=strPath
        Call MacrosName1
        Call MacrosName2
        
    End Sub
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

+ 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