Hi Community,
I have this macro that creates sheets for the names included in a List located in sheet within the same workbook. Once the sheets are created the macro runs a procedure for each of them. For simplification purposes, I've changed the process and included the word "hello" to be written by the macro in each sheet created.
The macro does the job in each page BUT nothing is done in the last name included in the List. There is no error message that tells me what I should do.
I am hoping that you may be able to assist and check if I have missed something in the macro and improving it so it does the job across each of the names in the List, please
I have this macro that creates sheets for the names included in a List located in sheet within the same workbook. Once the sheets are created the macro runs a procedure for each of them. For simplification purposes, I've changed the process and included the word "hello" to be written by the macro in each sheet created.
The macro does the job in each page BUT nothing is done in the last name included in the List. There is no error message that tells me what I should do.
I am hoping that you may be able to assist and check if I have missed something in the macro and improving it so it does the job across each of the names in the List, please
VBA Code:
Sub AAACreateSheetsAndIncludeTheWordHello()
Dim c As Range
Dim Ws As Worksheet
With Sheets("FundList")
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
For Each Ws In ThisWorkbook.Worksheets
If Ws.Name <> "ABC" And Ws.Name <> "BCD" And Ws.Name <> "FundList" Then
Range("a1").Value = "Hello"
Ws.Activate
Debug.Print Ws.Name
End If
Next
End Sub