Use Cell Values to Create Tabs with specific names
maybe something like this:
Sub test()
Dim lRow As Long
Dim sht As Worksheet
Dim shtTest As Worksheet
lRow = 1
Set sht = ActiveSheet
While sht.Range("A" & lRow).Text < ""
With sht.Range("A" & lRow)
On Error Resume Next
Set shtTest = Nothing
Set shtTest = Worksheets(.Text)
On Error GoTo 0
If shtTest Is Nothing Then
Worksheets("Template Tab").Copy After:=sht
ActiveSheet.Name = .Text
Else
Debug.Print .Text; " tab already exists"
End If
lRow = lRow + 1
End With
Wend
sht.Activate
End Sub
--
Hope that helps.
Vergel Adriano
"Mr. Matt" wrote:
I'd like to create a new tab for each cell in column A that has a value in it
using that cell's value as the tab name. I have a tab that the new ones
should all be copies of named "Template Tab". I'd like this to loop until it
finds a blank cell in column A and then stop.
Thanks in advance for your help!!
|