+ Reply to Thread
Results 1 to 3 of 3

How to simplify lengthy vba code

  1. #1
    Registered User
    Join Date
    04-06-2016
    Location
    Europe
    MS-Off Ver
    2010
    Posts
    2

    How to simplify lengthy vba code

    Hello everybody,

    What would be the best way to make code easier to read?

    The following code just checks to see if a certain value is between two other values, but it's rather lengthy and difficult to read. If I were to read it a month from now I'd have a hard time trying to figure out what it does (which is where comments get in), but more importantly how it does this.

    Please Login or Register  to view this content.
    I'm inclined to try to make

    Please Login or Register  to view this content.
    Into something like 'Object A' etc

    So that you get:
    Please Login or Register  to view this content.
    Is that possible?

    I'm not looking to optimize this specific piece of code, it runs fast enough.

    The code that I've produced so far is just generally quite lengthy and difficult to read.

    Thanks for your time.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to simplify lengthy vba code

    Welcome to the board.

    Please Login or Register  to view this content.
    Last edited by shg; 04-06-2016 at 03:29 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    04-06-2016
    Location
    Europe
    MS-Off Ver
    2010
    Posts
    2

    Re: How to simplify lengthy vba code

    Thanks for your help. My code is a lot more readable now.

+ 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. [SOLVED] Simplify code
    By KBSH in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2016, 03:20 PM
  2. [SOLVED] VBA, Simplify lengthy if condition
    By gan_xl in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-16-2014, 05:16 AM
  3. Shorten lengthy VBA Code to delete rows of data outside of multiple criteria
    By orenjisoda in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-20-2014, 09:49 PM
  4. [SOLVED] Lengthy In-Efficiant Code Linked with Combobox Needs to be Reduced
    By asgharhussaini in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-06-2013, 06:32 AM
  5. Shorten a lengthy code
    By Pyro Form in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-27-2012, 04:51 AM
  6. Adding conditions and variables to lengthy code
    By scowalt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2011, 03:37 AM
  7. Simplify this code
    By Scott in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2006, 12:00 AM

Tags for this Thread

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