+ Reply to Thread
Results 1 to 7 of 7

Looking to Cleanup my Code

  1. #1
    Registered User
    Join Date
    10-11-2007
    Posts
    11

    Looking to Cleanup my Code

    Just wondering if there is a more concise way to write this code. I just need it to put a zero in front of all single digit values, so 1 = 01.

    Please Login or Register  to view this content.

  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
    Format > Cells > Number > Custom -> 00

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    This structure is faster than repeated selections.
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    06-27-2006
    Posts
    310
    Please Login or Register  to view this content.
    Last edited by VBA Noob; 10-30-2007 at 03:48 PM.

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Or a event macro. Right click sheet and select view code and paste in the below

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  6. #6
    Registered User
    Join Date
    10-11-2007
    Posts
    11
    Thanks for all the replys I appreciate it, i think I am going to try out SuitedAces since the range is always constant.

    Thanks all

  7. #7
    Forum Contributor
    Join Date
    06-27-2006
    Posts
    310
    but Noob makes a good case with using the worsheet change event

    you could use the intersect method

    Please Login or Register  to view this content.
    Last edited by VBA Noob; 11-03-2007 at 06:39 AM.

+ 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