+ Reply to Thread
Results 1 to 14 of 14

How can I streamline/ speed up my code- it is currently crashing excel

  1. #1
    Forum Contributor
    Join Date
    04-19-2013
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    297

    How can I streamline/ speed up my code- it is currently crashing excel

    I have a code working fine- it looks to see whether data in column F matches a selection from a drop down list- and if it does copies across the respective data in column G to a new worksheet. Then it removes duplicates.

    I have tested it on a sample workbook.

    The problem is the real thing works from a sheet with over 100,000 rows of data and so just crashes excel every time it runs.

    Anybody got any ideas how I might streamline it/ make it run faster....the code is:

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: How can I streamline/ speed up my code- it is currently crashing excel

    Use filter. Please attach the sample.

  3. #3
    Forum Contributor
    Join Date
    04-19-2013
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    297

    Re: How can I streamline/ speed up my code- it is currently crashing excel

    I can only attach a sample workbook so the data is desensitised- but this wouldn't show how it struggles with the large number of rows.

    Is it best to upload a sample workbook so you can see what's going on anyway?

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: How can I streamline/ speed up my code- it is currently crashing excel

    Strud,
    Remove any confidential information. We are only interested to see the layout and format of your data. We also need to test the code. Please attach your sample.

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

    Re: How can I streamline/ speed up my code- it is currently crashing excel

    untested but perhaps
    Please Login or Register  to view this content.
    Last edited by JosephP; 08-14-2013 at 07:35 AM. Reason: error
    Josie

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

  6. #6
    Forum Contributor
    Join Date
    04-19-2013
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    297

    Re: How can I streamline/ speed up my code- it is currently crashing excel

    Ok so the codes I mean run when a selection is made on the 'Brands' and 'Parent' drop down lists on sheet2- you will see the data A1:C10 change.

    The sample static data is in sheet1. It will in reality be almost 90,000 rows as I mentioned.

    So that when say a selection is made on the Parent list excel crashes.

    Hope that makes it clearer.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    04-19-2013
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    297

    Re: How can I streamline/ speed up my code- it is currently crashing excel

    Thanks for that Joseph but unfortunately the following part of the code comes up as an error...

    Quote Originally Posted by JosephP View Post
    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: How can I streamline/ speed up my code- it is currently crashing excel

    Have you tried Jay's code on your actual data? If it works, it is very fast.

  9. #9
    Forum Contributor
    Join Date
    04-19-2013
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    297

    Re: How can I streamline/ speed up my code- it is currently crashing excel

    Yeah as I say
    Please Login or Register  to view this content.
    prompted the debugger

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

    Re: How can I streamline/ speed up my code- it is currently crashing excel

    I apologize-I was just now correcting that. the line ought to be
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    04-19-2013
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    297

    Re: How can I streamline/ speed up my code- it is currently crashing excel

    Actually looking back at your original code I think that's what it was and I somehow put that .Value in or left it in from before or something.

    Anyway- just tested the code and it works perfectly- rapid enough to be instantaneous pretty much.

    Massive thanks for your help Joseph!!

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

    Re: How can I streamline/ speed up my code- it is currently crashing excel

    you're welcome :-)

    please don't forget to mark the thread solved (click the 'thread tools' link at the top, then 'mark solved')

  13. #13
    Forum Contributor
    Join Date
    04-19-2013
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    297

    Re: How can I streamline/ speed up my code- it is currently crashing excel

    One more question if I may Joseph- How would I add into your code a sort function so the copied data in the new destination is sorted alphabetically?

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

    Re: How can I streamline/ speed up my code- it is currently crashing excel

    perhaps replace
    Please Login or Register  to view this content.
    by
    Please Login or Register  to view this content.

+ 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. Excel 2010 crashing when running macros....my code?
    By dietcoke802 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-20-2013, 05:56 PM
  2. Help to streamline my code.
    By gpwaters in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-21-2011, 02:55 PM
  3. Tips required to speed up / streamline working code generated by macro recorder.
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2010, 11:24 AM
  4. Streamline Code The Solution??
    By smillshome in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-07-2009, 09:03 AM
  5. [SOLVED] How can I streamline this repetitious piece of code?
    By Father Guido in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2006, 03:15 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