Results 1 to 5 of 5

Thread: Create copies of Worksheet (Master) based on a Range in another worksheet

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Hi

    Try this

    Code:
    Option Explicit
    Public Sub DuplicateSheetMultipleTimes()
    Dim wsUsrs As Worksheet: Set wsUsrs = ThisWorkbook.Worksheets("List of User")
    Dim wsMstr As Worksheet: Set wsMstr = ThisWorkbook.Worksheets("Master")
    Dim rngStr As Range, rngUsrs As Range
     Set rngUsrs = wsUsrs.Range("A1:A" & wsUsrs.Cells.Item(wsUsrs.Rows.Count, 1).End(xlUp).Row & "")
        
        For Each rngStr In rngUsrs
         wsMstr.Copy After:=ThisWorkbook.Worksheets.Item(ThisWorkbook.Worksheets.Count)
         Let ActiveSheet.Name = rngStr.Value
        Next rngStr
        
        
    
    
    
    
    
    '    Dim n As Integer
    '    On Error Resume Next
    '    n = InputBox("How many copies of the active sheet do you want to make?")
    '
    '    If n >= 1 Then
    '        For numtimes = 1 To n
    '            ActiveSheet.Copy After:=ActiveWorkbook.Sheets(Worksheets.Count)
    '        Next
    '    End If
    End Sub
    Last edited by DocAElstein; 01-02-2020 at 08:38 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Similar Threads

  1. Replies: 5
    Last Post: 08-17-2017, 08:12 AM
  2. Worksheet Tab Name Based on Cell Value
    By tuna666 in forum Excel Help
    Replies: 2
    Last Post: 10-08-2013, 10:41 PM
  3. 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
  4. Worksheet Change Event
    By jamilm in forum Excel Help
    Replies: 2
    Last Post: 12-29-2012, 12:06 AM
  5. Replies: 5
    Last Post: 12-05-2012, 03:01 AM

Posting Permissions

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