link to sheet

R

rlo

In Sheets("Students") a list was made with the names of alle students.

Every student has his own sheet

Next script makes a new sheet with students with the same skill

Works fine.

But... I don't want to have just the names, but the names must also becomes
hyperlinks to the students own sheet.



How can I change

Sheets("Preslijst").Cells(r2, 2) = Cells(r1, 1)

to a hyperlink.

Ronald

Arnhem

The Netherlands



Script:

Sub PreslijstMaken()

Dim r1 As Integer, r2 As Integer, last As Integer

Dim skill As String, vak1 As String, doc As String



'to startsheet with names of students

Sheets("Students").Select

Range("A1").Select



vak = Sheets("Students ").Range("x2")

If vak = "" Then Exit Sub

last = Range("A65536").End(xlUp).Row

r2 = 4

For r1 = 1 To last

If Application.WorksheetFunction.CountIf(Rows(r1),
vak) > 0 Then

Sheets("Preslijst").Cells(r2, 2) =
Cells(r1, 1)

r2 = r2 + 1

End If

Next r1

End Sub
 
D

Dave Peterson

See one response to your other post.
In Sheets("Students") a list was made with the names of alle students.

Every student has his own sheet

Next script makes a new sheet with students with the same skill

Works fine.

But... I don't want to have just the names, but the names must also becomes
hyperlinks to the students own sheet.

How can I change

Sheets("Preslijst").Cells(r2, 2) = Cells(r1, 1)

to a hyperlink.

Ronald

Arnhem

The Netherlands

Script:

Sub PreslijstMaken()

Dim r1 As Integer, r2 As Integer, last As Integer

Dim skill As String, vak1 As String, doc As String

'to startsheet with names of students

Sheets("Students").Select

Range("A1").Select

vak = Sheets("Students ").Range("x2")

If vak = "" Then Exit Sub

last = Range("A65536").End(xlUp).Row

r2 = 4

For r1 = 1 To last

If Application.WorksheetFunction.CountIf(Rows(r1),
vak) > 0 Then

Sheets("Preslijst").Cells(r2, 2) =
Cells(r1, 1)

r2 = r2 + 1

End If

Next r1

End Sub
 
Top