orange12345
New Member
- Joined
- Jan 25, 2016
- Messages
- 40
- Office Version
- 365
- Platform
- Windows
Hi there, I hope everyone is staying well and healthy.
I have a macro task: I'm building a student review workbook.
The first sheet is a consolidated student record sheet with each row has a student's first name, last name, score extra.
The second sheet is the individual template. Then followed the second sheet is the individual sheet for each student in the first sheet.
I'd like to give user ability to add a new student on the first sheet whenever needed and once they fill out the row, and click an add button. It will ask them the name of the sheet they would like and then the macro will copy the template sheet, fill out a few information on the template using the teacher filled info and rename it with the user-defined name, and on the same row of the first sheet, there would be a hyperlink created that once user clicked on that, it will direct them to that student sheet.
Thanks a lot. I was able to find macros that copy the template and create a new one. However, I didn't find a way to add the function for the hyperlink. I hope to get insights. Below is the macro I"m using for copying and renaming. Just the hyperlink part is missing.
Public Sub Copysheetandrename()
Dim newName as string
On Error Resume Next
NewName=InputBox("Enter the student name for the copied worksheet","Copy worksheet",ActiveCell.Value)
If newName<>""Then
ThisWorkbook.Worksheets("Templates").Copy Before:=Worksheets(sheets.Count)
On Error Resume Next
Activesheet.Name=NewName
End if
End sub
I have a macro task: I'm building a student review workbook.
The first sheet is a consolidated student record sheet with each row has a student's first name, last name, score extra.
The second sheet is the individual template. Then followed the second sheet is the individual sheet for each student in the first sheet.
I'd like to give user ability to add a new student on the first sheet whenever needed and once they fill out the row, and click an add button. It will ask them the name of the sheet they would like and then the macro will copy the template sheet, fill out a few information on the template using the teacher filled info and rename it with the user-defined name, and on the same row of the first sheet, there would be a hyperlink created that once user clicked on that, it will direct them to that student sheet.
Thanks a lot. I was able to find macros that copy the template and create a new one. However, I didn't find a way to add the function for the hyperlink. I hope to get insights. Below is the macro I"m using for copying and renaming. Just the hyperlink part is missing.
Public Sub Copysheetandrename()
Dim newName as string
On Error Resume Next
NewName=InputBox("Enter the student name for the copied worksheet","Copy worksheet",ActiveCell.Value)
If newName<>""Then
ThisWorkbook.Worksheets("Templates").Copy Before:=Worksheets(sheets.Count)
On Error Resume Next
Activesheet.Name=NewName
End if
End sub