+ Reply to Thread
Results 1 to 6 of 6

Large VBA Loop - Sometimes crashes!

  1. #1
    Registered User
    Join Date
    08-21-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    81

    Large VBA Loop - Sometimes crashes!

    Hi guys

    I have a large loop (10000) worth - and this is sometimes crashing and the time it does work takes forever! (My computer is pretty good)

    Here is the code -

    Wondering if anyone had a better way to preform the task?

    Thanks inadvance

    Please Login or Register  to view this content.

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Large VBA Loop - Sometimes crashes!

    Please Login or Register  to view this content.

  3. #3
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Large VBA Loop - Sometimes crashes!

    Perhaps:
    Please Login or Register  to view this content.
    The paste to Column C includes formulas AND formats. The remaining columns get values only.
    You can copy, paste, or assign values to cells directly (without selecting them). It's faster.
    Last edited by leelnich; 04-03-2018 at 06:19 AM.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  4. #4
    Registered User
    Join Date
    08-21-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    81

    Re: Large VBA Loop - Sometimes crashes!

    Hi

    Sorry tim that didnt work ! it was really fast but didnt calculate the formulas

    Thanks leelnich, same as above, doesnt seem to of copied the formulas?

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Large VBA Loop - Sometimes crashes!

    If I understand correctly.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  6. #6
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Large VBA Loop - Sometimes crashes!

    Your sample code pastes formulas from an 18-cell section of the first column into the second column (Offset(0,1)), but it only pastes the returned values from those 18 cells (Paste:=xlPasteValues) into the rest of the columns. Is this your intention, or do you wish to copy the formulas to ALL columns?
    Last edited by leelnich; 04-04-2018 at 07:03 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. Multiple crashes of Excel for Mac 2011 with large data sets
    By mskumar1512 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 07-29-2014, 08:40 PM
  2. Large Operation, then Excel crashes
    By swchoi89 in forum Excel General
    Replies: 15
    Last Post: 07-16-2013, 10:46 AM
  3. For loop crashes Excel when filling a cell range with string value
    By icyrius in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2013, 09:41 AM
  4. [SOLVED] Excel crashes while macro processes large text file
    By RitaG in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-05-2012, 10:34 AM
  5. large file uses massive memory - crashes
    By lotsbg in forum Excel General
    Replies: 1
    Last Post: 05-17-2012, 02:17 AM
  6. Loop Macro Crashes excel 2010
    By jmoon3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2012, 07:57 PM
  7. Macro loop crashes excel?
    By Lagitup in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2008, 10:30 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