I have hyperlinks on sheet "Data" in G17 to G23. I tried to write a Private sub to generate text "Select Macro on sheet" In Col I in the same Row as where the hyperlink has been selected
For eg If I click ion G18 , then this text to be generated in I18
I have written code but cannot get it to generate the text in Col I in the same row as the hyperlink tht has been clicked
Kindly amend my code
For eg If I click ion G18 , then this text to be generated in I18
I have written code but cannot get it to generate the text in Col I in the same row as the hyperlink tht has been clicked
Kindly amend my code
Code:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Dim rng As Range
Set rng = Range("G17:G23")
If Not Intersect(Target, rng) Is Nothing And Target.Hyperlinks.Count > 0 Then
' If yes, update the corresponding cell in column I with the message
Cells(Target.Row, "I").Value = "Select Macro on sheet
End If
End Sub