It's a pity that no reply till now. The good news is that I've got the solution from somewhere else. Let me share it here with those who concerned:
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
If Application.CountA(Range("I43:I44")) = 1 Then
play
End If
End Sub
Sub play()
Application.ScreenUpdating = False 'disable screen updating
With ActiveSheet
.Hyperlinks.Add Anchor:=.Range("J43"), _
Address:=Range("I43").Value, _
ScreenTip:="Play Video", _
TextToDisplay:="Watch"
Range("J43").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
End With
Application.ScreenUpdating = True 'enable screen updating
End Sub
|