+ Reply to Thread
Results 1 to 6 of 6

Calculation gets slow AFTER deleting tablerows

  1. #1
    Registered User
    Join Date
    06-28-2022
    Location
    Belgium
    MS-Off Ver
    Office365
    Posts
    4

    Calculation gets slow AFTER deleting tablerows

    Hello,

    I'm working on a Excel file with a table (116 cols, +/-2500 rows) with automatic formulas in hidden program colums.
    The calculation works smooth when changing or adding data and when filtering or adding rows.

    But, once tablerows are deleted (manually or with a macro), the calcutions suddenly get and remain slow.
    The time to delete the rows is not the issue. The problem is that all further operations become very slow (several seconds for simple input).
    The problems only occurs after deleting tablerows, not after inserting rows. But once the calculation has slown down, it remains slow even when inserting rows.

    When saving/closing the slow file and reopening it, it surprisingly just works smooth again !
    This makes me believe that the structure and formulas actually are ok.

    I can't find any explanation/reason for this.
    The formulas don't show any errors.
    I followed the standard rules and advises:
    - avoiding volatile functions
    - all data and formulas on same sheet
    - disabling calculation, screenupdating, ... in the beginning of the macro's (and resseting at the end)
    - even disabling all filters and hidden rows/columns in the beginning of the macro
    I tried different methods in VBA:
    - Tbl.Listrows(i).Delete
    - Selection.Entirerow.Delete
    - Intersect(Selection.Entirerow, Tbl.DatabodyRange).Rows.Delete
    These macros all work but result in slow calculation afterwards.
    Using similar programming in the macros to insert rows, does not slow down calculation !

    Does anybody know this issue ? Is there a solution ?

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,234

    Re: Calculation gets slow AFTER deleting tablerows

    Don't rule out the possibility that the problem originated in the workbook work layer (not accessible to us). If all formulas refer only to this worksheet try rebuilding the file:
    1. create a new file
    2. in the old file, copy only the range with the data and paste it into the new file. Do not copy the whole worksheet!
    3. rebuild the rows height and columns width, formatting, etc.
    4. copy the VBA code into the new file.

    Finally, report back if there is an improvement.

    Artik

  3. #3
    Registered User
    Join Date
    06-28-2022
    Location
    Belgium
    MS-Off Ver
    Office365
    Posts
    4

    Re: Calculation gets slow AFTER deleting tablerows

    Thank you Artik
    That's new for me. I've been building on this file over a long time so I can imagine something got wrong.
    As a first step I've deleted all (+/-2000) except one tablerow in the original file and then opened it again with restore.
    I inserted and copied back in all data. That allready seems to work up to now.
    When I have enough time I'll follow your advise to rebuild the entire file.

    Thanks again.
    Vincent

  4. #4
    Registered User
    Join Date
    06-28-2022
    Location
    Belgium
    MS-Off Ver
    Office365
    Posts
    4

    Calculated columns get slow AFTER deleting tablerows

    Hello,

    I found out that the calculation slows down after inserting as well as deleting tablerows.
    The problem seems to be related to calculated columns.
    When I insert/delete tablerows the formulas in all cells (also new cells after inserting) of the calculated columns are filled in automatically and are correct, but the calculation slows down (+/-10 times initial calculation time).
    The strange thing is that the calculation gets fast again when I copy and repaste the same formulas manually into the calculated columns without actually changing the formulas by doing so.
    Other solution is closing and reopening the file.

    Both methods are off course not a solution.

    I'm still hoping to understand the problem and to find a solution.
    Last edited by VincentCops; 07-12-2022 at 08:40 AM.

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Calculation gets slow AFTER deleting tablerows

    If you have very large data, you could use.

    Formula => count options => manual.


    After everything is complete

    Formula => count options => automatic.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  6. #6
    Registered User
    Join Date
    06-28-2022
    Location
    Belgium
    MS-Off Ver
    Office365
    Posts
    4

    Table filtering gets slow AFTER inserting/deleting tablerows

    Hello Oeldere,
    Thank you.
    I always use the settings (xlCalculationManual / xlCalculationAutomatic) in my macro's and the calculation initially works fine.

    The strange thing is that once I start inserting/deleting tablerows, the file becomes slow. The more rows I insert/delete the slower the file gets.
    I also use tablefilters to hide/show specific rows. I now get the impression that it's not the calculation getting slow but the filtering.
    I can repair it by copying/pasting the formulas in the calculated columns of the table OR by just closing/reopening the file. Then everything works smooth again.
    Last edited by VincentCops; 07-12-2022 at 11:16 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Slow deleting cells
    By lostsoul65 in forum Excel General
    Replies: 5
    Last Post: 09-07-2019, 11:51 AM
  2. [SOLVED] Deleting rows by specific values very slow
    By Vaslo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-31-2017, 01:37 PM
  3. Deleting rows = VERY SLOW RUN TIME
    By karacooks in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-02-2016, 09:49 PM
  4. Slow Calculation
    By Macphesto in forum Excel General
    Replies: 13
    Last Post: 08-13-2012, 06:55 PM
  5. Slow calculation
    By morpheus305 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 12-07-2009, 04:38 AM
  6. [SOLVED] Slow Calculation
    By JavyD in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-16-2006, 05:55 PM
  7. [SOLVED] Does this slow down calculation?
    By sfrancoe in forum Excel General
    Replies: 1
    Last Post: 01-15-2006, 11:45 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1