I am trying to Name new created worksheets based on list of names in sheets("Run") from range ("F4") to lastrow.
My problem: The macro is only creating one new worksheet, instead of creating new worksheets based on the number of names in the list. Please see my code below:
Sub new_1()
Dim RCount As Integer
Dim n As Integer
Dim test As Worksheet
Sheets("Security Distribution").Copy After:=Sheets(Sheets.Count)
Set test = ActiveSheet
Application.ScreenUpdating = False
Sheets("Run").Activate
RCount = Range(Range("F5000").End(xlUp), Range("F4")).Rows.Count
For n = 1 To RCount
test.Name = Sheets("Run").Range("F4").Offset(n - 1, 0)
Next n
Application.ScreenUpdating = False
End sub
Your operation to create the new worksheet(s) was outside the loop to rename. You would create a new worksheet and rename it a number of times.