Hi,
I have the code and it works as below.
I assigned the code to a button. Once I click on the button, it will copy the sample sheet with the sheet name that I provide, and the same name will be added to the summary page along with formula and format from the sample row. I need your help to create a hyperlink using the macro between the sheet and the sheet name updated on the summary page. Please help me where I need to add the line in the existing code below.
Also, before creating/copying the first new sheet, I will hide the sample sheet and the sample row in the summary page since no one should see it but I am facing an issue if I hide the sample sheet and the sample row in the summary page before creating/copying a new page and click on the button to create a new page, the new page and the row are hidden by themselves. please help.
Sub CreateNewSheet()
Dim str As String
str = InputBox("New Sheet Name", "")
If Not str = "" Then
With ThisWorkbook
.Sheets("Sample").Copy after:=.Sheets(.Sheets.Count)
.Sheets(.Sheets.Count).Name = str
With .Sheets("Summary")
.Rows(.Cells(.Rows.Count, 1).End(xlUp).Row + 1).FillDown
.Cells(.Rows.Count, 1).End(xlUp) = str
End With
.Sheets("Summary").Activate
End With
Else
MsgBox "You didn't enter a sheet name.", , ""
End If
End Sub
Bookmarks