+ Reply to Thread
Results 1 to 6 of 6

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 365
    Posts
    701

    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 Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    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?
    If I have 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
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,787

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

    Perhaps like this?

    Alf
    Attached Files Attached Files

  4. #4
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    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 08:54 AM.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

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

    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
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

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

    Hey,
    Try this.
    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)

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