Hello all,
I have the following VBA which will refresh my pivot when cells in the range are updated.
I want to include another Worksheet_Change shown below. This code is supposed to allow hyperlinks to function in the pivot. I've tested it separately but have been unable combine with the code above.
Can anyone help me combine these?
Thanks!
I have the following VBA which will refresh my pivot when cells in the range are updated.
VBA Code:
Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Set KeyCells = Range("I7:J7")
If Not Application.Intersect(KeyCells, Target) Is Nothing Then
Worksheets("CST View").PivotTables("AutoOL").PivotCache.Refresh
End If
End Sub
I want to include another Worksheet_Change shown below. This code is supposed to allow hyperlinks to function in the pivot. I've tested it separately but have been unable combine with the code above.
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count <> 1 Then Exit Sub
On Error Resume Next
Application.ActiveWorkbook.FollowHyperlink Address:=CStr(Target.Value), NewWindow:=True
End Sub
Can anyone help me combine these?
Thanks!