+ Reply to Thread
Results 1 to 4 of 4

Help speeding up code please

  1. #1
    Registered User
    Join Date
    02-25-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2007
    Posts
    2

    Help speeding up code please

    Hi,

    I'm new to working with VBA and would very much appreciate some assistance with the following:

    I've been working on some code that pulls data into a table in a new Sheet within a certain range, then deletes rows with zero value in columns E and I. I've managed to peice together the following that does the trick, but it seems a bit slow

    Please Login or Register  to view this content.
    Does anyone have any suggestions for edits to this that would speed it up please?

    If anyone could also explain what this bit really means aswell, that would be much appreciated:

    Please Login or Register  to view this content.
    Thanks!

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Help speeding up code please

    Try this...

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Help speeding up code please

    Hi AJC2012, welcome to the forum.

    Here's some general advice:
    1. You almost never need to "Select" objects. This also slows down the procedure.
    2. Deleting rows one by one can be really slow. It's better to delete all at once.

    Based on that I edited the code a little:
    Please Login or Register  to view this content.
    I hope it works for you. Cheers.
    Please Login or Register  to view this content.
    This means that you contain the row number of the last row in the lrow variable, then start to loop back from lrow to 4.

  4. #4
    Registered User
    Join Date
    02-25-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Help speeding up code please

    That worked perfectly.

    Thanks very much!

+ 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