+ Reply to Thread
Results 1 to 6 of 6

For each loop to create and name worksheets

  1. #1
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    For each loop to create and name worksheets

    The range A2:A6 contains 5 names. I would like to loop through the names, create a worksheet, rename the worksheet the string name, and place the name in cell A1 of the newly created worksheet. Next Name. Continue process until all names have been analyzed.

    Dummy worksheet attached.

    Thanks!!!!!
    Attached Files Attached Files
    Last edited by AlvaroSiza; 04-28-2011 at 01:04 PM. Reason: Solved

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: For each loop to create and name worksheets

    Try this:
    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: For each loop to create and name worksheets

    Quote Originally Posted by StephenR View Post
    Try this:
    Please Login or Register  to view this content.
    This was perfect. Thanks! How could I modify to have it, in addition to naming the sheet and placing the same name in A1, pre-populate A2-A5 of each worksheet with a VLOOKUP referencing the array EmpNameRange? Or would a different code suffice to pull the information x number of columns out during the process you set out previously?

    Revised excel attached.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: For each loop to create and name worksheets

    What information do you want to show in A2-A5?

  5. #5
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: For each loop to create and name worksheets

    Quote Originally Posted by StephenR View Post
    What information do you want to show in A2-A5?
    The corresponding data in Columns B & C.

    I added

    Please Login or Register  to view this content.
    After your:
    Please Login or Register  to view this content.
    ...which works just fine. I think you have me all set for now, Stephen. Thanks for taking the time to help me. Stay well!

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: For each loop to create and name worksheets

    Nice one. My pleasure.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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