Hello. I am trying to have a macro run when the value in $C$3 changes. This cell references the grand total in a pivot table on another worksheet that changes when I select different slicer options. I'm able to have this work correctly if I manually change the value in $C$3, but it does not run when that value changes as a result of changing the slicer selections. Is there a way to accomplish this?
Change Event
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$3" Then
Call HideRows
End If
End Sub
HideRows Macro
Sub HideRows()
'
' HideRows Macro
'
Rows("145:251").Select
Selection.EntireRow.Hidden = False
Dim r As Range, c As Range
Set r = Range("C33:a250")
Application.ScreenUpdating = False
For Each c In r
If Len(c.Text) = 0 Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next c
Application.ScreenUpdating = True
'
End Sub
Thank you
Change Event
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$3" Then
Call HideRows
End If
End Sub
HideRows Macro
Sub HideRows()
'
' HideRows Macro
'
Rows("145:251").Select
Selection.EntireRow.Hidden = False
Dim r As Range, c As Range
Set r = Range("C33:a250")
Application.ScreenUpdating = False
For Each c In r
If Len(c.Text) = 0 Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next c
Application.ScreenUpdating = True
'
End Sub
Thank you