+ Reply to Thread
Results 1 to 6 of 6

Make Codename macro shorter & possibly more efficient

  1. #1
    Forum Contributor
    Join Date
    05-25-2019
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Microsoft 365
    Posts
    188

    Make Codename macro shorter & possibly more efficient

    This code runs fine. However it is long and repetitive.
    I'm believing there's a way to loop something like this to make it shorter but I don't know how just yet. How do I set

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,697

    Re: Make Codename macro shorter & possibly more efficient

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-02-2020
    Location
    Idaho, USA
    MS-Off Ver
    365
    Posts
    274

    Re: Make Codename macro shorter & possibly more efficient

    Run the macro in this test file. It doesn't care what the sheets are currently named or how many there are. It just renames all the sheets except the first one to the values you have starting in B2.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,788

    Re: Make Codename macro shorter & possibly more efficient

    How about
    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Make Codename macro shorter & possibly more efficient

    Please Login or Register  to view this content.
    P.S
    You need to;
    Go to
    File --> Options --> Trust Center --> Trust Center Settings --> Macro Settings.
    Check Trust Access to the VBA project object model.
    Last edited by jindon; 08-14-2021 at 11:12 AM.

  6. #6
    Forum Contributor
    Join Date
    05-25-2019
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Microsoft 365
    Posts
    188

    Re: Make Codename macro shorter & possibly more efficient

    Gurus, thank you for your generous offers. Unfortunately, I've come to learn that the code I've originally written does not work for what I intended after all. So, therefore none of you offers will have any impact on my problem. And, I am so sorry for posting my question before learning of this problem.

    I will post the file for your review for you to see why but I fully understand if you decide to move on and not attempt any further suggestions.
    Anyways, my original code does not work because it becomes corrupt when try to sort cells A1:E17 in ABC order or if I clear any of the values in cell B2:B17. The B-column cells are what I'm using to try and rename the worksheets in a reliable manner. I might still come up with an alternative option... but so far, am awfully stymied.

    Again, I am gracious for your generosity. Thank you much for sharing. This is very educational for me.
    Attached Files Attached Files

+ 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. Make VBA Macro more efficient
    By boubou114 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-18-2015, 10:32 AM
  2. Replies: 2
    Last Post: 08-12-2014, 12:56 PM
  3. [SOLVED] Make a macro more efficient/faster
    By jhonneyboy in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 06-25-2014, 05:38 PM
  4. Make Copy/Paste Values Macro more efficient when calculating
    By Phily915 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2014, 04:28 PM
  5. Macro takes 20 seconds to run, can anyone please help to make it more efficient?
    By Adrian1981 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-31-2013, 11:24 PM
  6. Macro takes 20 seconds to run, can anyone please help to make it more efficient?
    By Adrian1981 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2013, 06:44 PM
  7. How to make systematic repetitive macro shorter?
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-05-2011, 01:22 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