VBA Help Naming Sheets
Sub addsheets()
Set sheetnames = Range("B7:B25")
For Each cell In sheetnames
Found = False
For Each sht In ThisWorkbook.Sheets
If sht.Name = cell Then
Found = True
Exit For
End If
Next sht
If Found = False Then
Worksheets.Add after:=Sheets(Sheets.Count)
ActiveSheet.Name = cell
End If
Next cell
End Sub
"jlclyde" wrote:
I am lookign for some help on VBA. I need a new sheet named after
each employee that i add to a list. I want simple code that I can
just activate with a button or other command later. So after I add
the employee to a list of names, I want code to be able to go through
the list and find names that are not the same as ones that are already
worksheets and add them. I hope this is possible.
Thanks,
Jay
|