+ Reply to Thread
Results 1 to 8 of 8

Create Worksheets named after cells in a range

  1. #1
    Registered User
    Join Date
    02-19-2019
    Location
    Amsterdam, The Netherlands
    MS-Off Ver
    MS Office 2010
    Posts
    24

    Create Worksheets named after cells in a range

    Hi All,

    I have a range of cells, let's say B2:B6 with various names.

    Now I would like to create worksheets for each of those names.

    I have written the following, but it gives an error on line "sheets.name (cell)" with the error: "Compile error: method or data not found".

    Additionally, besides giving a name, I would like to add data to each sheet. But I can just add a command for that after this is fixed.

    Thank you

    Please Login or Register  to view this content.

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

    Re: Create Worksheets named after cells in a range

    How about
    Please Login or Register  to view this content.

  3. #3
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Create Worksheets named after cells in a range

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  4. #4
    Registered User
    Join Date
    02-19-2019
    Location
    Amsterdam, The Netherlands
    MS-Off Ver
    MS Office 2010
    Posts
    24

    Re: Create Worksheets named after cells in a range

    Hi Fluf,

    Your code works, thank you.

    However, I have difficulty reading this.

    Quote Originally Posted by Fluff13 View Post
    How about
    Please Login or Register  to view this content.
    Evaluate is used to shorten code, isref to check for a reference.. So, you check to see if it is purely a value and not a reference?

    Thank you

  5. #5
    Registered User
    Join Date
    02-19-2019
    Location
    Amsterdam, The Netherlands
    MS-Off Ver
    MS Office 2010
    Posts
    24

    Re: Create Worksheets named after cells in a range

    Quote Originally Posted by Mumps1 View Post
    Try:
    Please Login or Register  to view this content.
    Thank you Mumps1, for you also a question.. Why the set ws = nothing?

    I understand the

    Please Login or Register  to view this content.
    But the rest seems vague to me.

    Hope you can explain a bit, thank you!

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

    Re: Create Worksheets named after cells in a range

    The Evaluate line is there to check that the sheet does not already exists.
    If the sheet exists the isref function will return true & so it will not try to create it again.

  7. #7
    Registered User
    Join Date
    02-19-2019
    Location
    Amsterdam, The Netherlands
    MS-Off Ver
    MS Office 2010
    Posts
    24

    Re: Create Worksheets named after cells in a range

    Quote Originally Posted by Fluff13 View Post
    The Evaluate line is there to check that the sheet does not already exists.
    If the sheet exists the isref function will return true & so it will not try to create it again.
    Thank you for the clarification. Reputation is added

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

    Re: Create Worksheets named after cells in a range

    Glad to help & thanks for the feedback

+ 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. [SOLVED] Compare cells to named range and create new sheets using related named range
    By drewship in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-10-2015, 03:35 PM
  2. [SOLVED] create MsgBox for cells within named range
    By bob07904 in forum Excel General
    Replies: 6
    Last Post: 02-22-2015, 10:33 AM
  3. Replies: 5
    Last Post: 03-04-2014, 12:43 PM
  4. Create a named range of cells BUT variable in reference to a cell value
    By peponfree in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 02-13-2014, 12:46 PM
  5. [SOLVED] Copy and paste cells dynamically to a range in a series of named Worksheets.
    By skyping in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-27-2012, 04:22 AM
  6. Format cells in a named range across worksheets
    By Andy_N in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-13-2011, 11:55 AM
  7. Replies: 1
    Last Post: 06-03-2006, 10:55 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