Results 1 to 4 of 4

Copy and Move Template Sheet To Last Sheet in Workbook

Threaded View

  1. #1
    Forum Contributor
    Join Date
    04-07-2020
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    219

    Copy and Move Template Sheet To Last Sheet in Workbook

    Hi There, I have been searching through solutions for copying and moving a specific worksheet in my workbook (“Template”) to the very last sheet or behind the last sheet. Because I will eventually have many sheets (more than 30) I have opted to hide them (very hidden) and the users selects them from hyperlinks on a main page, after use and selecting a different sheet the active sheet that the user worked on goes back to very hidden.

    Anyway, the problem I have is that when sheets are very hidden the code below cannot pick that up and just copies the “Template” sheet to the next visible sheet and not at the end of the last string of hidden sheets – hope that makes sense.

    I came accords some Functional ideas but I would like to generate this through a command button when needed rather than a function. I would also like to keep the option where a message box pops up and the user can type the name of the new sheet


    Sub Copy_Workbook_VeryLast()
    Dim Answer As Variant
    lastSheet = Sheets.Count
        Sheets("Template").Copy after:=Sheets(lastSheet)
        Answer = InputBox(prompt:="What do  want to name this sheet. The name must contain no spaces. If space is required use underscore ( _  e.g New_Name)", _
            Title:="          We need a Name for this Sheet")
    If Answer = "" Then Exit Sub
        ActiveSheet.Name = Answer
    End Sub

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA code to Copy rename and move sheet to new workbook
    By Excelski in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2019, 03:34 AM
  2. [SOLVED] Copy a template sheet to end of workbook using a InputBox to rename
    By NZ_Shane in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-12-2016, 10:09 AM
  3. move sheet from one workbook to another ( copy of sheet)
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-05-2014, 06:07 PM
  4. Move data to new sheet and create copy of template sheet
    By jdm13 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-25-2014, 01:53 PM
  5. Macro, copy UNLOCKED cell range of sheet in open workbook to workbook template
    By NicksDad in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-31-2012, 11:18 AM
  6. [SOLVED] Multiple copy of the same sheet on new workbook (template like)
    By flordix in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-06-2012, 01:12 AM
  7. Find and Open Workbook then copy and move sheet
    By cwilson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2005, 05:54 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