I have a list of employees and I would like code to run on a button click that will copy a template sheet (Blank MAP) rename it from the emp list and continue to do this until it finds a blank cell.
My code works sometimes but when it does it is really slow. There is other code needed to grab the emp name, emp id and paste them into specific cells as well but my focus is on the worksheet creation right now.
Below is the code to create the sheets:
Sub UpdateMAPs()
Application.ScreenUpdating = False
Dim i As Integer
Dim ShName As String
i = 2
Do
Sheets("Team List").Select
ShName = Cells(i, 5).Value
Sheets("Blank MAP").Select
Sheets("Blank MAP").Copy Before:=Sheets("Blank MAP")
Sheets("Blank MAP (2)").Name = ShName
i = i + 1
Loop Until IsEmpty(Cells(i, 5).Value)
End Sub
As you can tell I am fairly new to vba so the code might be sloppy.
My code works sometimes but when it does it is really slow. There is other code needed to grab the emp name, emp id and paste them into specific cells as well but my focus is on the worksheet creation right now.
Below is the code to create the sheets:
Sub UpdateMAPs()
Application.ScreenUpdating = False
Dim i As Integer
Dim ShName As String
i = 2
Do
Sheets("Team List").Select
ShName = Cells(i, 5).Value
Sheets("Blank MAP").Select
Sheets("Blank MAP").Copy Before:=Sheets("Blank MAP")
Sheets("Blank MAP (2)").Name = ShName
i = i + 1
Loop Until IsEmpty(Cells(i, 5).Value)
End Sub
As you can tell I am fairly new to vba so the code might be sloppy.