Add new named sheets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a list of names that is filtered and need help creating a macro that
take the names from the filtered list and create a tab for each name. I also
need to add a hyperlink next to each name that will take me directly to the
new tab that was created for that name.

Thanks to anyone who can help!
 
Hi David:
Try this out:

Sub david()
Dim wks As Worksheet
Dim v As String
L = Cells(Cells.Rows.Count, "A").End(xlUp).Row
MsgBox (L)
With Sheets("Sheet1")
For i = 2 To L
If .Cells(i, "A").EntireRow.Hidden = False Then
v = .Cells(i, "A").Value
Set wks = Worksheets.Add
wks.Name = v
.Hyperlinks.Add Anchor:=.Cells(i, "B"), Address:="", SubAddress:= _
v & "!A1", TextToDisplay:=v
End If
Next
End With
End Sub
 
Back
Top