Some error checking
Sub Macro1()
Dim Lr As Long, M As Long
Dim NWsht As Worksheet
Dim SrcSht As Worksheet
Set SrcSht = Sheets("Sheet1") ' Change to your name
Lr = Cells(Rows.Count, "A").End(xlUp).Row
Application.ScreenUpdating = False
On Error Resume Next
For i = 2 To Lr
Set NWsht = Sheets.Add
NWsht.Move After:=Sheets(Sheets.Count)
NWsht.Rows(2).Value = SrcSht.Rows(i).Value
NWsht.Name = NWsht.Range("A2").Value
If Err.Number <> 0 Then
MsgBox Err.Number & " " & Err.Description
Err.Clear
M = MsgBox("Stop Macro!!", vbYesNo)
If M = vbYes Then
Exit For
End If
End If
Next i
Application.ScreenUpdating = True
End Sub
VBA Noob
Bookmarks