I am trying to create sheets from a list but if I run the code more than once I get an error as it try's to recreate the same sheets again (only want to create ones I have added. I also want sheets to delete if I remove the name from the list.
VBA Code:
Sub test()
Application.ScreenUpdating = False
lastcell = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
For i = 6 To lastcell
With ThisWorkbook
newname = Sheet1.Cells(i, 1).Value
.Sheets.Add after:=.Sheets(.Sheets.Count)
ActiveSheet.Name = newname
End With
Next
Application.ScreenUpdating = True
End Sub