Activate sheet to run macro in another workbook

  • I have the Macro below which currently runs in a workbook called Golf File,
    I want to have this macro in a seperate workbook as it produces results, and is only required at the very end of the season, how can I modiify it so that when I activate the sheet in the new workbook that it will open and run the macro through the workbook Golf File.



    I hope this makes some sense, and thanks for any help :?

  • Re: Activate sheet to run macro in another workbook


    Hi Barry


    If I understand, place the Private Worksheet code in the golf file (I have assummed Sheet 1) and in the current one replace the code with

    Code
    Workbooks.Open "c:\My Documents\Golf File.xls"
    ActiveWorkbook.Sheets(1).Activate
  • Re: Activate sheet to run macro in another workbook


    Sorry, The macro is currently in a workbook named golf file, I want to put it in a new workbook called results and when the results workbook is activated the macro will run and search through the workbook golf file and retreive the results as it currently does.


    Sorry about the confusion. Thanks for the help. :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!