Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA Functions recalculating when calculation is manual

    I have some VBA functions that are used for cells in a sheet. When other VBA code runs, and I disable calculation (Application.Calculation=xlManual), I still see that the functions are called when I write values to other places on the sheet or even to other sheets. This slows down my code significantly; how can I force these functions NOT to be called?

  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
    How specifically are you seeing that they are called?
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code is slow and when I'm stepping to my code, I see the code ump to the functions severeal times every time I write a cell from VBA

  4. #4
    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
    That will happen when stepping through - it does not mean it happens at runtime.
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well... I'd like to believe you but that seems somewhat odd to me to be honest. My code is significantly slower and why would it step into it if I debug and not when it runs...? I'll try to put a debug.print in the function-code and see if that triggers when I run normally and will let you know.

Posting Permissions

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