Share via

VBA Support - Call Macros Based on Changes

Anonymous
2023-06-26T06:53:43+00:00

Hi.

I have some VBA code in a module that makes changes to a file. That macro works perfectly.

However, I want it to activate (rather than me having to run it manually) either when a slicer selection changes to any different selection - doesn't matter what the selection is I just need it to process the data in the other macro accordingly (slicer is called Slicer_Month on a sheet called Dashboard) , or alternatively run when the output of that slicer change makes a pivot table value update (Cell F7 on a sheet called Pivots).

I have looked at using worksheet_change and worksheet_calculate functions but with limited success.

The additional challenge is that i also want the other macro to run when another slicer has its selection change (also doesn't matter what the selection is) - the second slide is called Slicer_Month 1 on the Dashboard sheet and the pivot value is F34 on the Pivots sheet.

The macro to be called is called Paired_Scores

Can anyone point me in the right direction please?

Thanks.

Liz.

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2023-06-26T07:07:26+00:00

Worksheet.PivotTableChangeSync event (Excel) | Microsoft Learn

Private Sub Worksheet_PivotTableChangeSync(ByVal Target As PivotTable)

'Pivots is your povit table name.

If Target.Name = "Pivots" Then

 MsgBox "test" 'Your code here.

End If

End Sub

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2023-06-26T07:21:56+00:00

    You are welcome.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2023-06-26T07:20:26+00:00

    That's great - it worked perfectly - thank you!!

    Was this answer helpful?

    0 comments No comments