Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    Victoria, Texas, USA
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Running Macros (Excel 97)

    Hi,
    I need to run a macro when my spreadsheet recalculataes. I have read that this can be done but I have been unable to find any documentation on it. Any help would be greatly appreciated.
    Jim

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

    Re: Running Macros (Excel 97)

    There is a Workbook Sheet Calculate event routine that executes when any sheet in the workbook recalculates, and there is a Worksheet Calculate event routine for each sheet in the workbook that will execute when that particular sheet recalculates.

    Go to the VBE by pressing Alt+F11 from a worksheet. In the project explorer on the left of the screen find your workbook. If there is a plus sign next to the workbook name, click on it to expand the workbook tree. If there is a plus sign next to the "Microsoft Excel Objects" line, click on it to expand that tree. If you want the workbook calculate event routine, double click on the ThisWorkbook object. If you want a sheet calculate event routine, double click on the sheet object. In the right window, there should be two combo boxes at the top of the edit area. Drop down the left list and select Worksheet if you double clicked on a sheet object or Workbook if you double clicked on ThisWorkbook. Drop down the right combo and select SheetCalculate if you double clicked Workbook or Calculate if you double clicke a sheet object. You should now have a Worksheet_Calculate or a Workbook_SheetCalculate routine where you can put your 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
  •