+ Reply to Thread
Results 1 to 6 of 6

Rename all worksheets created from macro according to list on Column A

  1. #1
    Valued Forum Contributor ron2k_1's Avatar
    Join Date
    09-30-2009
    Location
    Not the USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    606

    Rename all worksheets created from macro according to list on Column A

    Hi everyone,

    I wrote this piece of code [tell me where I messed up if I did here - so far it works good]:
    Please Login or Register  to view this content.
    What I have on sheet one is x number of records starting from row 2 to i. On A2:A? I have numbers from 1 to ?; on A1 I have Max of Col A, so that second part of the code above can work. The first part just deletes everything except sheet1 and 2 in case someone presses the button to generate more than once. My question is: Is it possible to rename all those created sheets starting from 1 to ? (which is the value on A1) in ascending order?.

    Please look at the attached if needed.

    Cheers,
    Attached Files Attached Files
    Last edited by ron2k_1; 02-25-2011 at 01:07 PM.
    Ron
    Knowledge is knowing that a tomato and pepper are fruits. Wisdom is knowing whether to put these in a fruit salad

    Kindly

    [1] Use code tags. Place "[code]" before the first line of code and "[/code"]" after the last line of code. Exclude quotation marks
    [2] Mark your post [SOLVED] if it has been answered satisfactorily by editing your original post in advanced mode.
    [3] Thank (using the little scale) those that provided useful help; its nice and its very well appreciated

  2. #2
    Valued Forum Contributor ron2k_1's Avatar
    Join Date
    09-30-2009
    Location
    Not the USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    606

    Re: Rename all worksheets created from macro according to list on Column A

    hey crew,

    I've been playing around this code for a while now, and for the love of me I cannot make it rename the 15 (in this case) new worksheets created to follow the range in Sheet1!A2:A16.
    Please Login or Register  to view this content.
    The sorting is not been done properly as well. Help please.

    Thanks,

  3. #3
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Rename all worksheets created from macro according to list on Column A

    Hi ron2k_1
    Do you mean

    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    Last edited by pike; 02-25-2011 at 04:17 AM.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  4. #4
    Valued Forum Contributor ron2k_1's Avatar
    Join Date
    09-30-2009
    Location
    Not the USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    606

    Re: Rename all worksheets created from macro according to list on Column A

    Thanks pike,

    I've come up with the following. So far so good (if you notice I changed your code to name my sheets based on Column A and not Column B)

    Please Login or Register  to view this content.
    How do I make the newly created sheets sort in ascending order? My try at that is not really working.

    Thanks,
    Last edited by ron2k_1; 02-25-2011 at 01:06 PM.

  5. #5
    Valued Forum Contributor ron2k_1's Avatar
    Join Date
    09-30-2009
    Location
    Not the USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    606

    Re: Rename all worksheets created from macro according to list on Column A

    I'm sorry, I had already marked this solved. Thanks pike for the code above. However, when renaming the worksheets, the code names them in descending order (meaning it takes the last value in column 1, and works it way up - last row to first row). I'd like it to rename the sheets on the other way, from row 2 of column A of Sheet1. So in that way by the time the code is finished doing what its supposed to do, the created sheets will be in numerical order (values in Col A row 2 onwards, are numbers from 1 to i)

    Thanks,

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Rename all worksheets created from macro according to list on Column A

    Hi ron2k_1
    you can re-reverse the loop
    Please Login or Register  to view this content.

+ 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