Results 1 to 2 of 2
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Northern, California, USA
    Thanked 0 Times in 0 Posts

    Calling code from another sheet (97 SR2)

    Here's my dillema:

    I've got a sheet(we'll call it 'compiler') which contains a sub i'd like to run. The sheet opens a series of 100+ worksheets, extracts data from each of them, and pastes the data to a master sheet.

    the Compiler sheet will be opened from a History sheet , which will then pull the resulting data from the 'compiler' sheet, and paste it into History.

    The compiler sheet contains a sub named 'process'. How can I execute this 'process' sub from the History sheet? After executing that sub, how can I make the History sheet wait for the compiler to complete?

    Once the compiler sheet is running the process sub, is there a way for me to send code back to the history sheet? (History contains a makeshift progress bar, which uses a calculation (number of files / current file number) to progress itself.

    It all makes sense on paper, hopefully it makes sense to you all... any help you could provide would be Wonderful!

    <IMG SRC=>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    South Carolina, USA
    Thanked 0 Times in 0 Posts

    Re: Calling code from another sheet (97 SR2)

    You can use the Run command to execute a macro in another workbook:

    <pre> Application.Run "C:MyDirCompiler.xls!Process"

    The calling macro will not get control back until the macro is finished running.

    What kind of code are you trying to send back? VBA code?
    Legare Coleman

Posting Permissions

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