Sub AddWorksheets()
Dim i As Integer
For i = 3 To 10
If Not WorksheetExists(Sheets("Sheet1").Cells(i, 1).Value) Then
Sheets.Add
ActiveSheet.Name = Sheets("Sheet1").Cells(i, 1).Value
Else
End If
Next
End Sub
Public Function WorksheetExists(ByVal WorksheetName As String) As Boolean
On Error Resume Next
WorksheetExists = (Sheets(WorksheetName).Name <> "")
On Error GoTo 0
End Function
|