+ Reply to Thread
Results 1 to 4 of 4

tidying up code

  1. #1
    Valued Forum Contributor
    Join Date
    11-16-2004
    Location
    Devon UK
    MS-Off Ver
    2010
    Posts
    357

    tidying up code

    I am going to have a go at re writing some code I wrote a couple of years ago (with a lot of help from you guys), implementing some of the things I have learnt and with the intention of reducing the size of the code and making it more efficient.
    Can you please help with a few starters, all of these work but I am sure there is a better way of acheiving the same thing:

    1) copying and inserting columns
    Please Login or Register  to view this content.
    2) deleting various columns
    Please Login or Register  to view this content.
    3) deleting selected columns
    Please Login or Register  to view this content.
    Finally I frequently use the line:
    Please Login or Register  to view this content.
    Is there an advantage (or disadvantage) in using the .value as it appears to work without it

    Thanks in advance
    Last edited by tryer; 12-14-2011 at 10:02 AM.

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,417

    Re: tidying up code

    Hi,

    Code #1. Something seems missing since you are copying column R but not pasting it anywhere. No need to use .Select
    Shortened version:
    Please Login or Register  to view this content.
    Code #2. Again no need to use .Select:
    Please Login or Register  to view this content.
    Code #3. .Value can be used or not depending on the situation (e.g. when you you want the result of a formula rather the contents of the cell itself which is the forumla.

    Hope this helps.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Valued Forum Contributor
    Join Date
    11-16-2004
    Location
    Devon UK
    MS-Off Ver
    2010
    Posts
    357

    Re: tidying up code

    Thank you abousetta it does help, this is much neater

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,417

    Re: tidying up code

    Hi @tryer, glad I could help and thanks for marking the thread as Solved.

    Good luck.

    abousetta

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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