EliseFreedman
Programmer
Hi There
I am trying to create a FAQ which will sit in an excel report that we have developed.
Ideally, I want the user to be able to click on the hyperlink for the question that they want to know the answer to. The question will then be displayed on another area in the worksheet with the answer displayed below.
I am using the following code but although it does move the cursor to the cell required, it doesn't update the value. Not sure where I am going wrong?
I am trying to create a FAQ which will sit in an excel report that we have developed.
Ideally, I want the user to be able to click on the hyperlink for the question that they want to know the answer to. The question will then be displayed on another area in the worksheet with the answer displayed below.
I am using the following code but although it does move the cursor to the cell required, it doesn't update the value. Not sure where I am going wrong?
Code:
Dim GSourceCell As String
Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As Hyperlink)
'Update cell B2 in Destination sheet based on the origin of hyperlink
If Sh.Name = "Sheet1" Then
If GSourceCell = "C8" Then
Sheets("Sheet1).Range("J8").Value = "What Courses Do I need to Complete?"
ElseIf GSourceCell = "C9" Then
Sheets("Sheet1).Range("J8").Value = "How do I access the courses"
ElseIf GSourceCell = "C10" Then
Sheets("Sheet1).Range("J8").Value = "I have already completed the courses but am still getting invites"
Else
Sheets("Sheet3").Range("J8").Value = ""
End If
End If
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.Name = "Hyperlinks" Then
'Capture last active cell on Hyperlinks worksheet and store in global variable
GSourceCell = Target.Address(False, False)
End If
End Sub