+ Reply to Thread
Results 1 to 7 of 7

Loop running very slow

  1. #1
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Loop running very slow

    Hi Expert,

    need help for optimizing the mentioned loop code.
    it is running very slow.


    Please Login or Register  to view this content.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Loop running very slow

    Can you explain what you trying to do?

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Loop running very slow

    What is the code actually doing and what's the end result you need? Consider whether a loop is necessary at all since more often that not loops are not the most elegant way of achieving your goal

    You should generally avoid stuff like .Select which just slows things down.

    Upload the workbook with a before and manually created after situation so that we can offer a more considered response.
    Last edited by Richard Buttrey; 12-16-2017 at 03:42 PM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: Loop running very slow

    There are data validation drop down list with named range in multiple column
    User also have feasibility to copy paste records in those columns
    I want to check whether the entered values are same as given in the dropdown list
    If not, I undo the process.

    What I am doing in the code?
    Once the user entered the record
    I check 500 cells of each column VS each record of the named range.

    What can be helpful?
    If I can able to check only those cells for which the value is changed

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Loop running very slow

    Why aren't you using data validation in from wherever the users are copying data?

    As I said upload the workbook with a before and after and explain what sorts if things users copy and paste.

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Loop running very slow


  7. #7
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: Loop running very slow

    yes, but as you can see i come up with code now and having issue with code

    as i didn't got any help on the earlier post, i tried to write code by my own, but got stuck here with slow loop

+ 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. VBA running slow
    By Toonies in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-25-2013, 04:13 PM
  2. Macro is running real slow and makes navigating the worksheet really slow after execution.
    By MichWolverines in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2013, 04:29 PM
  3. [SOLVED] Loop running slow
    By Sean Thomas in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-14-2013, 04:49 AM
  4. Macro to hide/unhide cells not running or running slow
    By mbp727 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-17-2013, 04:22 PM
  5. Excel running slow?
    By penfold1992 in forum Excel General
    Replies: 3
    Last Post: 09-05-2012, 10:05 AM
  6. My code is running pretty slow with the loop that i have
    By Josh_123456 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-20-2007, 07:20 PM
  7. Loop running really slow...?
    By Buffyslay in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-26-2006, 09:40 AM
  8. VBA running VERY slow
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2005, 12:05 PM

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