Results 1 to 6 of 6

Thread: Copy Template Worksheet And Rename With Custom Name

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Moderator
    Join Date
    Jul 2012
    Posts
    156
    Rep Power
    14
    Dear Peter,
    Sorry for the delayed response, but this is what i came up with.
    If you select a date from an excisting sheet you will be directed to that sheet (the old functionality).
    If you select a date from a non-excisting sheet you will be prompted wether you want to make a new sheet. Incase you selected a wrong date you can cancel at this point by clicking No.
    Else the Template-sheet will be copied and renamed to the selected date.
    The only thing you have to do before running this is that you have to locate the Change_Sheet sub in the calenderform and change the sheetname next to SheetToCopy.

    P.s.
    You will also notice that i've made some other changes to the original code.
    Instead of repeating the same code 42 times for each button i have made one mastercode (Change_Sheet) which recieves an argument x.
    In each Click-event from all buttons you refer to this mastercode and pass the argument.
    The main advantages of this method are first of all you save a lot of lines of code and secondly if you make a change that applies to all buttons you only make the change in the mastercode instead of changing it 42 times.
    Attached Files Attached Files
    Last edited by bakerman; 06-07-2013 at 07:33 AM.

Similar Threads

  1. How to Add Custom List And Use in Custom Sorting
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 06-07-2013, 10:41 PM
  2. Replies: 1
    Last Post: 05-21-2013, 11:58 AM
  3. Dynamic Worksheet Generator Sheet Copy
    By mfaisalrazzak in forum Excel Help
    Replies: 2
    Last Post: 03-01-2013, 05:38 PM
  4. Print Nth Worksheet To Mth Worksheet using VBA
    By Ryan_Bernal in forum Excel Help
    Replies: 2
    Last Post: 02-28-2013, 06:57 PM
  5. Rename Filename Through VBA
    By Excel Fox in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 08-30-2011, 08:29 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •