Add new named sheets

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!
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top