I'm new to excel VBA and I am trying to accomplish inserting a hyperlink in a cell using a VBA code. Upon clicking that value, I want to be able to open a hidden sheet.
What I have accomplished so far is this: open a hidden sheet using buttons.
Sub mainModule(ByVal a_Sheets As String)
'Hide all tabs
For Each sht In ActiveWorkbook.Sheets
If sht.Name <> "MAIN" Then sht.Visible = xlSheetVeryHidden
Next
'View tabs when button is clicked
For i = 0 To UBound(Split(a_Sheets, ","))
Sheets(Split(a_Sheets, ",")(i)).Visible = True
Sheets(Split(a_Sheets, ",")(i)).Activate
Next
End Sub
Sub goHere_Click()
Call mainModule("BIRTHDAYS")
End Sub
What I want to do is when I click "GO HERE", it will open the hidden sheet.
Moreover, I found something that might help me solve this.
Sub sbCreatingHyperLink()
ActiveSheet.Hyperlinks.Add Range("A5"), "https://www.google.com"
End Sub
Could help me figure out a way wherein instead of "https://www.google.com", it will call a function module instead (Call mainModule("BIRTHDAYS"))? Thank you.


