+ Reply to Thread
Results 1 to 6 of 6

Thread: VBA Help need to Create Sheets and Sheet name as per cell values

  1. #1
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 2010
    Posts
    120

    Question VBA Help need to Create Sheets and Sheet name as per cell values

    Hi Folks,

    I want to create new sheets when I click on the "Create Sheet" button (Sheet name should be same as values of Cells A2, A3, A4 till A10). If the Sheet name is already exist I want to show a warning message like "Some sheets already exist, Do you want to delete the existing sheet and create new?” And if I click on the "OK" button (in the Warming Message box) I want to create sheets If I click “Cancel” button nothing to do. Please help me.. I have attached a file of what I'm trying to accomplish. Thanks in advance for your expertise!


    Thanks in advance.

    Joshi
    Attached Files Attached Files

  2. #2
    Forum Moderator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    4,376

    Re: VBA Help need to Create Sheets and Sheet name as per cell values

    So should just blank sheets be created with no data in them? Or do you want some existing tab to be copied and then certain cells to be cleared so you can enter fresh data? Kind of like a template?
    Cheers,
    Arlette

    If I helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Valued Forum Contributor
    Join Date
    03-13-2004
    Location
    Gothenburg/Stockholm, Sweden
    MS-Off Ver
    Excel 2003 and reluctantly Excel 2007
    Posts
    631

    Re: VBA Help need to Create Sheets and Sheet name as per cell values

    Perhaps like this?

    Alf
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    Japan
    MS-Off Ver
    Excel 2010
    Posts
    779

    Re: VBA Help need to Create Sheets and Sheet name as per cell values

    I went a different approach to Alf(I did this a day or so ago, so may as well post it up).

    Activate the cell you want to check if a sheet exist and click create sheet.
    Attached Files Attached Files
    Last edited by JapanDave; 01-02-2012 at 07:54 AM.
    If you are happy with the answer, please click the Star icon in the below left hand corner.

    Good sites to start learning.

    snb's VBA Help Files
    Jerry Beaucaires Excel Assistant
    J & R Excel Consultancy Services

    How to post code correctly: Correct Code Posting

  5. #5
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 2010
    Posts
    120

    Re: VBA Help need to Create Sheets and Sheet name as per cell values

    Hi JapanDeve,

    Its almost OK, but I need to add one more criteria, If Sheet does not existing the macro should create new sheet based on active cell value "Sheet Name = Active cell value". Can you please help me?


    Thanks in advance

    Joshi

  6. #6
    Valued Forum Contributor JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    Japan
    MS-Off Ver
    Excel 2010
    Posts
    779

    Re: VBA Help need to Create Sheets and Sheet name as per cell values

    Hey,
    Try this.
    Attached Files Attached Files
    If you are happy with the answer, please click the Star icon in the below left hand corner.

    Good sites to start learning.

    snb's VBA Help Files
    Jerry Beaucaires Excel Assistant
    J & R Excel Consultancy Services

    How to post code correctly: Correct Code Posting

+ 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.2.0