Results 1 to 10 of 10

Copy a template sheet to end of workbook using a InputBox to rename

Threaded View

  1. #1
    Registered User
    Join Date
    09-11-2016
    Location
    Kalgoorlie, Australia
    MS-Off Ver
    2010
    Posts
    5

    Copy a template sheet to end of workbook using a InputBox to rename

    Hi, my first post and only new to VBA so if I'm in the wrong area or haven't supplied enough info I apologise !!

    I want to have a button set up so users can click it - a inputbox opens up "Enter New Sheet Name" then once you type that in it copies the two template sheets I have set up and pastes them to the end of the workbook with the entered name followed by "_Form" and "Chart"


    This is what I currently have -
    Sub New_Prism()
        
        
        Dim sName As String
        Dim wks_form As Worksheet
        Dim wks_chart As Worksheet
           
        Set wks_form = Worksheets("Form_Template")
        wks_form.Copy After:=Sheets(Sheets.Count)
    
        Set wks_form = ActiveSheet
        Do While sName <> wks.Name
            sName = Application.InputBox _
              (Prompt:="Enter new worksheet name")
            On Error Resume Next
            wks.Name = sName & "_Form"
            On Error GoTo 0
        Loop
        Set wks = Nothing
    End Sub
    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer

    It creates the one sheet I have in the macro but then gets stuck in a loop...?

    Any help would be really appreciated!!

    Thank you in advance
    Last edited by 6StringJazzer; 09-11-2016 at 08:07 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copy Template Sheet and rename the new sheets based on a list in another sheet
    By SaadKiji in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-05-2016, 11:47 AM
  2. [SOLVED] Copy a sheet, rename it by value in range then export product to new workbook and rename
    By MagicMan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-31-2015, 07:24 PM
  3. Copy template sheet and rename according to list
    By tkensen89 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2015, 05:13 PM
  4. Replies: 8
    Last Post: 02-26-2013, 01:00 AM
  5. [SOLVED] Copy a sheet (from template) to a new sheet, and rename (based on cell value)
    By Siglen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-30-2012, 10:19 AM
  6. copy template,past new sheet and rename to given date for 30 days
    By fasalazar in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2012, 05:19 PM
  7. Copy and rename a sheet in an existing workbook?
    By robertse in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-09-2010, 02:00 PM

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