+ Reply to Thread
Results 1 to 23 of 23

15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

  1. #1
    Registered User
    Join Date
    04-06-2012
    Location
    Livermore, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    I am working with 273 column X 16394 row excel sheet. I did something really stupid and i put the MAX() function in 26 of the columns. It only took me about 5-10 minutes to paste these functions into excel, but for some reason its going to take ~15 hours to delete it.

    I successfully deleted one of the 26 columns and it took 36 minutes. I did some experimenting and I found that the first and last 1000 cells in a column only take 20 seconds to delete. But the 1000 cells in the middle of the column take 3 minutes to delete.

    The file is 27 Mb so i can only upload a small portion. I highlighted the columns causing my grief.

    Is there a simple way to get excel to use all 4 of my cores to delete these cells? I am a little bit of a newbie to vba so hopefully its not going to take more than 14 hours of effort to learn this.

    And yes my excel is set to manual calculation.

    Any suggestions or help is appreciated

    -Daniel
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    04-06-2012
    Location
    Livermore, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    BTW is there a way to disable undo tracking?

  3. #3
    Registered User
    Join Date
    04-06-2012
    Location
    Livermore, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    Quote Originally Posted by motivef View Post
    BTW is there a way to disable undo tracking?
    I figured it out. I had to regedit. It didnt help.

  4. #4
    Registered User
    Join Date
    04-06-2012
    Location
    Livermore, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    I did some reading and found that excel keeps a record of all linkages in a given sheet. So everytime I delete a =MAX() it is rebuilding this table. I am guessing multi threading is not going to speed up rebuilding this table. What I need is for excel to delete everything and then rebuild the table from scratch.

  5. #5
    Registered User
    Join Date
    04-06-2012
    Location
    Livermore, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    Can i at least get a "your so screwed" or maybe an insult or something? At least then i wont feel like i'm talking to myself.

  6. #6
    Registered User
    Join Date
    04-06-2012
    Location
    Livermore, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    49,152 cells complete, 376832 to go

  7. #7
    Registered User
    Join Date
    04-06-2012
    Location
    Livermore, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    I dont understand why there is so much animosity toward microsoft, i mean they must of done something right if there products are so ubiquitous. Excel has definitely served me well. And i kind of like Win7.

    I have to go to a meeting, i will be back in ~45 min.

  8. #8
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    Hi Motivef
    Maybe it will be easier not to remove the unwanted columns, but to copy the desired columns in a new tab (or book)?

  9. #9
    Registered User
    Join Date
    04-06-2012
    Location
    Livermore, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    Quote Originally Posted by nilem View Post
    Hi Motivef
    Maybe it will be easier not to remove the unwanted columns, but to copy the desired columns in a new tab (or book)?
    You are totally correct, that is indeed way faster. However I am too lazy to recreate the 8 plots that reference the data.

    BTW thanks for posting!!!

  10. #10
    Registered User
    Join Date
    04-06-2012
    Location
    Livermore, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    65536 cells complete, 360668 to go

  11. #11
    Valued Forum Contributor
    Join Date
    05-07-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    354

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    have you tried setting calculation to manual?

    That should help.
    Regards,
    Vandan

  12. #12
    Registered User
    Join Date
    04-06-2012
    Location
    Livermore, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    Quote Originally Posted by vandan_tanna View Post
    have you tried setting calculation to manual?

    That should help.
    Ya I tried that. It doesnt help. Thanks for the post anyway!

  13. #13
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    are you actually deleting the columns or just clearing the cells?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  14. #14
    Registered User
    Join Date
    04-06-2012
    Location
    Livermore, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    Quote Originally Posted by JosephP View Post
    are you actually deleting the columns or just clearing the cells?
    Thanks for the post!

    I've tried:
    clearing the cells
    Pasting over the cells
    Autofilling over the cells

    All of these perform similarly

    And yes deleting the column is a bad idea.

  15. #15
    Registered User
    Join Date
    04-06-2012
    Location
    Livermore, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    Here is my plan:
    1) Write macro to paste over cells i dont want
    2) Run said macro
    3) Go home
    4) Drink beer

  16. #16
    Registered User
    Join Date
    07-18-2012
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    the drink beer sounds like a good idea ....
    I hope your problem is now solved.

    This is a strange forum .. lots of readers .. not many suggesting solutions???

  17. #17
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    Quote Originally Posted by michael_aussie View Post
    This is a strange forum .. lots of readers .. not many suggesting solutions???
    that's normal for this kind of forum in my experience. most people are either searching or asking questions-only a relatively small percentage actually answer.

  18. #18
    Registered User
    Join Date
    07-18-2012
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    Hi Joesphp ..... not all forums are like that ... other forums I'm a member of have helps of people with good knowledge ready to help out a stuck newbie.

  19. #19
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    I put =1 in C10 and double-clicked to copy down, repeated that in M10, then cleared both columns. Took a total of about 3 minutes.
    Entia non sunt multiplicanda sine necessitate

  20. #20
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    Quote Originally Posted by michael_aussie View Post
    Hi Joesphp ..... not all forums are like that ... other forums I'm a member of have helps of people with good knowledge ready to help out a stuck newbie.
    what're you doing here then? ;-)

  21. #21
    Registered User
    Join Date
    07-18-2012
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    to the OP....

    without understanding the full impact of your problem...

    why couldn't you use the "replace" function in the tool bar to replace the MAX() function with something easier to handle??

  22. #22
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    that seems to be just as slow as deleting the cells-it's as though the calculation chain is being rebuilt even with manual calculation. (if you replace = with '= to disable all formulas, which takes a while to process, then deleting columns C and M is instantaneous)

  23. #23
    Registered User
    Join Date
    04-06-2012
    Location
    Livermore, CA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: 15 hours processor time to delete my mistake :(. Multi-threaded deleting in vba?

    I got network errors all day on Friday. Otherwise i would have responded sooner.
    Quote Originally Posted by shg View Post
    I put =1 in C10 and double-clicked to copy down, repeated that in M10, then cleared both columns. Took a total of about 3 minutes.
    Thanks for the benchmark. I actually get about the same for file i posted. The 27 Mb file takes much longer. This makes sense if excel is rebuilding the formula linkage table over and over again. The more linkages on a sheet, the larger the table is.

    The beer strategy worked. On Friday morning all the cells were updated. This made a huge difference in the general performance of working with my sheet.

    ---------- Post added at 09:24 AM ---------- Previous post was at 09:21 AM ----------

    Quote Originally Posted by JosephP View Post
    that's normal for this kind of forum in my experience. most people are either searching or asking questions-only a relatively small percentage actually answer.
    I think in this case, there really is no easy solution. The slowness is caused by the way excel updates its formula linkage table. The only way to fix this is to rewrite excel.

    hmmm.... This gives me an idea, I wonder if open office does any better with this problem? I cant test it because i dont have admin rights on my work computer.[COLOR="Silver"]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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