Created
May 25, 2019 04:29
-
-
Save DataSolveProblems/1854b08fe21b82dab5dfe5df4ad6232b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Create_Worksheets() | |
Dim rowNumber As Long, LastRow As Long | |
Dim ws As Worksheet, wsList As Worksheet | |
Set wsList = ThisWorkbook.Worksheets("MyList") | |
With wsList | |
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row | |
For rowNumber = 2 To LastRow | |
Set ws = ThisWorkbook.Worksheets.Add | |
ws.Name = .Cells(rowNumber, "A").Value | |
Set ws = Nothing | |
Next rowNumber | |
End With | |
End Sub | |
Sub DeleteWorksheets() | |
Dim ws As Worksheet | |
Application.DisplayAlerts = False | |
For Each ws In ThisWorkbook.Worksheets | |
If ws.Name <> "MyList" Then ws.Delete | |
Next ws | |
Application.DisplayAlerts = True | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment