+ Reply to Thread
Results 1 to 3 of 3

Speed-readability trade-off

  1. #1
    Registered User
    Join Date
    08-12-2013
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    58

    Speed-readability trade-off

    Hi,

    I have a very long code that was written as one chunk and is not very comfortable to read. I would like to break the code into smaller subs and functions for readability.
    My problem is that in most cases, a piece of code with a defined purpose changes more than one variable (often of different types), which forces me to use functions that output variants, and this reduces the speed significantly.
    Is there any way to organize the code better without compromising speed?

    Thanks,
    Chen

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,888

    Re: Speed-readability trade-off

    If I understand what you are asking, I think one solution would be to use module level variables (assuming all of the procedures are in the same module). This article has a nice discussion of "variable scope" http://www.cpearson.com/Excel/Scope.aspx
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    08-12-2013
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    58

    Re: Speed-readability trade-off

    You understood correctly. I tested your suggestion on a sample code and it looks promising!
    (I tried solving the problem using public declaration, but your way works much better)
    Many thanks!

+ 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. Better Readability Chart from Individual charts
    By thilag in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-28-2015, 12:51 PM
  2. background colours to improve readability
    By johnandrews in forum Excel General
    Replies: 3
    Last Post: 12-24-2013, 06:04 AM
  3. Excel Macro for Readability Statistics
    By bairdgbaird in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-29-2012, 04:16 PM
  4. Formatting chart data to improve readability
    By hockey99 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 07-27-2011, 04:21 AM
  5. Flesch readability in Excel 2007
    By sjvneste in forum Excel General
    Replies: 0
    Last Post: 05-18-2011, 02:08 PM
  6. How do I improve code readability
    By j_Southern in forum Excel General
    Replies: 7
    Last Post: 01-20-2011, 08:06 AM
  7. improve the readability of my graph
    By oresto in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-24-2008, 05:33 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