Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Mar 2001
    Location
    New York, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Recalculate (XL2000)

    I am having problems with Private Sub Worksheet_Calculate(). It dosen't recalculate? I looked to see if I had some switch settings wrong but have not found the problem yet. I can step through it and it works fine. Just can't get it to do it automatically.

    I also tried Private Sub Workbook_SheetCalculate(ByVal Sh As Object) and can't even step my code through it. It just beeps when I hit F8.

    Any thought or experiences?

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Recalculate (XL2000)

    Hi,
    I presume you have Tools-Options-Calculation set to automatic?
    Can you post the code in your calculate event just in case? Is it simply that nothing is happening?
    Regards,
    Rory

    Microsoft MVP - Excel

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

    Re: Recalculate (XL2000)

    Where are you putting this code? In a normal module or in the module that is behind the worksheet? If you are putting it in a normal module, it will not execute automatically. You need to double click on the worksheet object in the object browser. Then in the left drop down list select worksheet, then select the Change event in the right drop down list. This should display an empty change event routine in the edit window. Put your code there.
    Legare Coleman

  4. #4
    Star Lounger
    Join Date
    Mar 2001
    Location
    New York, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Recalculate (XL2000)

    Rory, Autocalc is on.

    Legare,

    I had it in a normal module. I didias you suggested and it works with
    change event but dosen't seem to work with Calculate event.?
    Attached Files Attached Files

  5. #5
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Recalculate (XL2000)

    Thom,
    It works for me - what are you doing to trigger the calculation?
    Regards,
    Rory

    Microsoft MVP - Excel

  6. #6
    Star Lounger
    Join Date
    Mar 2001
    Location
    New York, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Recalculate (XL2000)

    I am using F9.

  7. #7
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Recalculate (XL2000)

    Thom,
    That doesn't always force the sheet to recalculate - if nothing has changed on it, or there aren't any formulae, it seems to skip it. If you do Ctrl-Alt-f9 it will force recalculation, but again, only if there are formulae on the sheet for it to calculate.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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