You can achieve this by using VBA code to change the fill color of the destination cell after hyperlinking, and then revert back to the original fill color after a certain amount of time. Here's a step-by-step guide:
- Press Alt + F11 to open the VBA editor (on a Mac, press Option + F11).
- In the "Project Explorer" pane on the left, double-click on the sheet where the hyperlink is located.
- Copy and paste the following code into the code window:
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Dim destinationCell As Range
Dim originalColor As Long
Dim delaySeconds As Long
' Set the delay time (in seconds) before reverting the cell color back
delaySeconds = 5 ' You can change this value according to your needs
' Get the destination cell
Set destinationCell = Range(Target.SubAddress)
' Store the original fill color
originalColor = destinationCell.Interior.Color
' Change the fill color of the destination cell
destinationCell.Interior.Color = RGB(255, 255, 0) ' Yellow color
' Wait for the specified delay time
Application.Wait (Now + TimeValue("00:00:" & CStr(delaySeconds)))
' Revert the fill color of the destination cell back to the original color
destinationCell.Interior.Color = originalColor
End Sub
- Modify the delaySeconds variable value according to your preference. This value sets the time in seconds before the cell reverts back to its original color.
- Close the VBA editor and return to your Excel workbook.
Now, when you click a hyperlink in the worksheet, the destination cell will be highlighted temporarily before reverting back to its original fill color. Note that this code will work for hyperlinks within the same worksheet.
Keep in mind that Excel 2016 for Mac has some limitations in VBA support compared to the Windows version, but the provided code should work without issues on your platform.