Audi,
With a blank workbook open type your desire sheet names in cell A1, A2,... and so on
1. Then Press Alt+F11 on your keyboard. You will open the Visual Basic Editor.
2. Double click Sheet on on the Project properties (top right corner)
3. On the Right side (the white space) paste the following VBA code
Sub CreateSheetsFromList()
Dim R As Range
For Each R In Selection.Cells
If R.Text <> vbNullString Then
If SheetExists(R.Text, ThisWorkbook) = False Then
With ThisWorkbook.Worksheets
.Add(after:=.Item(.Count)).Name = R.Text
End With
End If
End If
Next R
End Sub
Private Function SheetExists(SHName As String, WB As Workbook) As Boolean
On Error Resume Next
SheetExists = CBool(Len(WB.Worksheets(SHName).Name))
End Function
Courtesy of CPearson
4. Close the VB Editor and Select your list
5. Open the Visual Basic toolbar (View >Toolbars>Visual Basic)
6. Run the Sub CreateSheetsFromList macro
Note: The code tests whether a sheet already exists with the particular name, and won't create a new sheet if that name is already in use, but it doesn't test whether the name is valid for a new worksheet (i.e. funny characters "&","/", et al).
Regards,
nrage21
Bookmarks