+ Reply to Thread
Results 1 to 5 of 5

Clean and speedup vba code

  1. #1
    Forum Contributor
    Join Date
    05-30-2015
    Location
    Dubai
    MS-Off Ver
    Excel 2016 Mac & PC & 365
    Posts
    633

    Clean and speedup vba code

    Hi,

    This may be a silly question.......but, is there such a thing as utility or programme that code can be entered into and it cleans it and speeds up the running of the code.

    I have dipped my toe in the world of VBA and with some macro recordings and code kindly offered on this site have created a sheet that works for my purposes
    The problem with it is it blinks a lot while running and appears slow, that said it could be normal??

    Any suggestions greatly appreciated

    Kevin

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Clean and speedup vba code

    There is no magic "single solution" but there are techniques you can adopt, things to do, things not to do

    This will prevent most of the blinking and probably speed up your code:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Other examples:
    - avoid "Selecting" objects in VBA - it is usually not necessary
    - during VBA execution make calculations happen in memory rather than the worksheet by using variables (including arrays) instead of cell ranges
    - avoid using loops if there are other ways to identify the data required
    .. etc ...


    Click on this article for several useful examples
    Last edited by kev_; 10-31-2017 at 06:17 AM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Clean and speedup vba code

    Good morning Excelski

    As far as I know there isn't a utility that will tidy / speed up your VBA code, but there are tricks you can implement that will speed things up enormously.
    the screen flickering thing is annoying, but normal, but it can be avoided.

    The attached article gives some tips on how to speed up your code, but you'll probably find that item 2 is all you need to make a phenomenal difference.
    https://www.soa.org/News-and-Publica...s42-roper.aspx

    HTH

    DominicB

  4. #4
    Forum Contributor
    Join Date
    05-30-2015
    Location
    Dubai
    MS-Off Ver
    Excel 2016 Mac & PC & 365
    Posts
    633

    Re: Clean and speedup vba code

    kev_ & Dominicb

    Thank you, both! blinking has stopped and I have lots to read
    Hopefully one of the articles will tell me how to stop holding my breath and stop not talking when recording a macro!!

  5. #5
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Clean and speedup vba code


+ 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. SpeedUp and Optimize My Code
    By mwinning8 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-07-2017, 05:25 PM
  2. VBA Code clean up
    By DHHM in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2015, 03:41 AM
  3. Have VBA code that needs performed in multiple sheets. Also help being sure code is clean
    By baby_kay_2003 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-17-2014, 10:57 PM
  4. [SOLVED] code clean up
    By promoboy2 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-03-2012, 06:06 PM
  5. [SOLVED] Clean up code
    By Grilleman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2012, 03:18 PM
  6. [SOLVED] VBA Code to optimize and clean data- clean out numerical/ or symbol
    By tracylsr in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-05-2012, 04:21 PM
  7. speedup the code for deleting rows
    By maheshwow in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-17-2012, 02:41 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