+ Reply to Thread
Results 1 to 2 of 2

Macros across multiple files

  1. #1
    peterhine21
    Guest

    Macros across multiple files

    I have 6 files that i wish to open and run a macro on. I have set up another
    file that contains a macro that is intended to runs all six. However it runs
    through the macro in the first file and then finishes without starting the
    second file.

    I'm quite new to macros and obviously missing something here. Help !

    Sub Update_PFT_Reports()
    '
    ' Update_PFT_Reports Macro
    ' Macro recorded 01/06/2006 by Peter Hine
    ' ChDir "\\Havuksfp01\havantreporting\Daily_reporting\Current"
    ' Keyboard Shortcut: Ctrl+Shift+U
    '
    Workbooks.Open Filename:= _
    "\\Havuksfp01\havantreporting\Daily_reporting\Current\Consolidated
    PFT Daily report back up data.xls"
    Application.Run _
    "'Consolidated PFT Daily report back up data.xls'!Update_and_save"
    Workbooks.Open Filename:= _
    "\\Havuksfp01\havantreporting\Daily_reporting\Current\Blocks &
    Ultronics Daily report back up data.xls"
    Application.Run _
    "'Blocks & Ultronics Daily report back up data.xls'!Update_and_save"
    Workbooks.Open Filename:= _
    "\\Havuksfp01\havantreporting\Daily_reporting\Current\4V3 & 4V5
    Daily report back up data.xls"
    Application.Run _
    "'4V3 & 4V5 Daily report back up data.xls'!Update_and_save"
    Workbooks.Open Filename:= _
    "\\Havuksfp01\havantreporting\Daily_reporting\Current\Batch & Props
    Daily report back up data.xls"
    Application.Run _
    "'Batch & Props Daily report back up data.xls'!Update_and_save"
    Workbooks.Open Filename:= _
    "\\Havuksfp01\havantreporting\Daily_reporting\Current\Hose Daily
    report back up data.xls"
    Application.Run _
    "'Hose Daily report back up data.xls'!Update_and_save"
    Workbooks.Open Filename:= _
    "\\Havuksfp01\havantreporting\Daily_reporting\Current\MMVP Daily
    report back up data.xls"
    Application.Run _
    "'MMVP Daily report back up data.xls'!Update_and_save"
    End Sub

  2. #2
    FSt1
    Guest

    RE: Macros across multiple files

    hi,
    it would have helped if you had posted your code.
    I did this once with 12 files.
    I created a Master file that contained all of the 12 macros. i created a
    13th macro that....
    opened file 1 then called the macro that was supose to run in that file.
    after running macro1 in file 1, the 13th macro saved and closed file1. it
    then open file 2 and called macro2 and so on.

    not that much help but maybe it'll give you the general idea.

    regards
    FSt1

    "peterhine21" wrote:

    > I have 6 files that i wish to open and run a macro on. I have set up another
    > file that contains a macro that is intended to runs all six. However it runs
    > through the macro in the first file and then finishes without starting the
    > second file.
    >
    > I'm quite new to macros and obviously missing something here. Help !
    >
    > Sub Update_PFT_Reports()
    > '
    > ' Update_PFT_Reports Macro
    > ' Macro recorded 01/06/2006 by Peter Hine
    > ' ChDir "\\Havuksfp01\havantreporting\Daily_reporting\Current"
    > ' Keyboard Shortcut: Ctrl+Shift+U
    > '
    > Workbooks.Open Filename:= _
    > "\\Havuksfp01\havantreporting\Daily_reporting\Current\Consolidated
    > PFT Daily report back up data.xls"
    > Application.Run _
    > "'Consolidated PFT Daily report back up data.xls'!Update_and_save"
    > Workbooks.Open Filename:= _
    > "\\Havuksfp01\havantreporting\Daily_reporting\Current\Blocks &
    > Ultronics Daily report back up data.xls"
    > Application.Run _
    > "'Blocks & Ultronics Daily report back up data.xls'!Update_and_save"
    > Workbooks.Open Filename:= _
    > "\\Havuksfp01\havantreporting\Daily_reporting\Current\4V3 & 4V5
    > Daily report back up data.xls"
    > Application.Run _
    > "'4V3 & 4V5 Daily report back up data.xls'!Update_and_save"
    > Workbooks.Open Filename:= _
    > "\\Havuksfp01\havantreporting\Daily_reporting\Current\Batch & Props
    > Daily report back up data.xls"
    > Application.Run _
    > "'Batch & Props Daily report back up data.xls'!Update_and_save"
    > Workbooks.Open Filename:= _
    > "\\Havuksfp01\havantreporting\Daily_reporting\Current\Hose Daily
    > report back up data.xls"
    > Application.Run _
    > "'Hose Daily report back up data.xls'!Update_and_save"
    > Workbooks.Open Filename:= _
    > "\\Havuksfp01\havantreporting\Daily_reporting\Current\MMVP Daily
    > report back up data.xls"
    > Application.Run _
    > "'MMVP Daily report back up data.xls'!Update_and_save"
    > End Sub


+ 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