+ Reply to Thread
Results 1 to 4 of 4

How can I speed up this sheet event code?

  1. #1
    Forum Contributor BeachRock's Avatar
    Join Date
    11-01-2011
    Location
    Oregon, United States
    MS-Off Ver
    Excel 2016
    Posts
    403

    How can I speed up this sheet event code?

    This event code runs and works but it is extremely slow. I found it at http://www.vbaexpress.com/kb/getarticle.php?kb_id=512 It was only tested with Excel 2000 and 2003 but it does exactly what I needed so I tried it in 2010. I'm hoping someone can help to speed it up by making it more compatible with 2010 or just replace it completely with something known to work in 2010 to accomplish the same but isn't slow.

    I downloaded the example file and ran it (in 2010 as .xls macro enabled) and it works very fast, almost immediately for the 16 rows within it's range. I'm using it for 180 rows. Still, it doesn't seem like it should take as long as it does, around two minutes for my additional rows.

    Basically, I need the code to only check the cells in A1:A180 and hide all rows where the cell in column A is blank. Those that are not blank will always have a 1 in them. It has to be a sheet event and needs to be fast since the sheet may be selected often.

    Please Login or Register  to view this content.
    Thanks for any help or suggestions you can provide!
    Last edited by BeachRock; 11-28-2012 at 02:24 AM.
    -------------
    Tony

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: How can I speed up this sheet event code?

    I tested it, less than 2 seconds for 180 rows
    If solved remember to mark Thread as solved

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

    Re: How can I speed up this sheet event code?

    I reckon you oughta just use an autofilter
    Josie

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

  4. #4
    Forum Contributor BeachRock's Avatar
    Join Date
    11-01-2011
    Location
    Oregon, United States
    MS-Off Ver
    Excel 2016
    Posts
    403

    Re: How can I speed up this sheet event code?

    Hi patel45 and JP. Thanks for replying.

    Joseph, unfortunately, I can't use auto-filter because I'm trying to automate the process completely so other users who know little to nothing about Excel will be able to do everything without help.

    patel45, Thank you for testing this on 2010 for me. I'm shocked it ran so quickly for you. Did you have any data at all in columns A through T? My sheet will have data in all of those columns when the formulae in them match certain criteria from another sheet. Maybe this is the problem of why it's running so slow for me??

+ 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