+ Reply to Thread
Results 1 to 3 of 3

Clean up code

  1. #1
    Forum Contributor
    Join Date
    12-14-2012
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    143

    Clean up code

    I am looking to see if any of the following code could be cleaned up? Any help would be greatful
    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Clean up code

    Perhaps post a sample Workbook and a detailed explanation of what you want to do..

    There's many ways your code coudl be cleaned up..

    Example:
    Please Login or Register  to view this content.

    Could be :
    Please Login or Register  to view this content.
    But, regardless.. a Workbook attached an clear explanation will serve your needs better..

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,119

    Re: Clean up code

    Another common example:

    Please Login or Register  to view this content.

    can be written:

    Please Login or Register  to view this content.

    That will remove the need to select cells, etc.

    Given that a lot of the code is repetitive, you would do better to create a subroutine that executes the common code. Sometimes, only one parameter varies and, in that case, it could be passed to the subroutine.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. Clean up my code!
    By Mr ZN in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-07-2013, 12:19 AM
  2. Code clean up
    By zplugger in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-07-2012, 07:17 PM
  3. [SOLVED] code clean up
    By promoboy2 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-03-2012, 06:06 PM
  4. [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
  5. VBA code clean up help
    By recon427 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-17-2012, 01:19 AM

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