.
Paste in a REGULAR MODULE :
Option Explicit
Sub CopyMaster()
Dim ws As Worksheet, sh As Worksheet
Dim Rws As Long, rng As Range, c As Range
Set sh = Sheets("List")
Set ws = Sheets("Template")
Application.ScreenUpdating = False
With sh
Rws = .Cells(Rows.Count, "A").End(xlUp).Row
Set rng = .Range(.Cells(2, 1), .Cells(Rws, 1))
End With
For Each c In rng.Cells
If WorksheetExists(c.Value) Then
MsgBox "Sheet " & c & " exists"
Else:
ws.Range("D4").Value = c.Value
ws.Range("D5").Value = c.Offset(0, 1).Value
ws.Copy After:=Worksheets(Worksheets.Count)
Worksheets(Worksheets.Count).Name = c.Value & " - " & ws.Range("D5").Value
End If
Next c
ThisWorkbook.Save
Application.ScreenUpdating = True
MsgBox "Process Complete !", vbInformation, "Task Progress"
End Sub
Function WorksheetExists(WSName As String) As Boolean
On Error Resume Next
WorksheetExists = Worksheets(WSName).Name = WSName
On Error GoTo 0
End Function
Bookmarks