Hi Community,
I found this macro below which I adjusted to include sheets to my workbook. The sheets are named using the text (January, February, March) included in column A of the sheet called "List".
How could this be adjusted so:
1. When new names are added to the "List", the macro includes worksheets for the new names e.g. April, May
2. The macro does not double up with the ones already included e.g. January, February, March
3. The macro deletes the sheets that have been excluded from the "List"? e.g. January no longer included in the "List"
Your assistance would be greatly appreciated
I found this macro below which I adjusted to include sheets to my workbook. The sheets are named using the text (January, February, March) included in column A of the sheet called "List".
How could this be adjusted so:
1. When new names are added to the "List", the macro includes worksheets for the new names e.g. April, May
2. The macro does not double up with the ones already included e.g. January, February, March
3. The macro deletes the sheets that have been excluded from the "List"? e.g. January no longer included in the "List"
Your assistance would be greatly appreciated
VBA Code:
Sub AAACreateSheets()
Dim c As Range
Dim Ws As Worksheet
With Sheets("List")
For Each c In .Range("A2", .Range("A" & Rows.Count).End(3))
If c.Value <> "" Then
Sheets.Add After:=Sheets(.Name)
ActiveSheet.Name = c.Value
End If
Next
End With
End Sub