Msg Box to appear when page selection changes in a Pivot Table

  • Thread starter Thread starter Mustang
  • Start date Start date
M

Mustang

Does anyone know how I can create a macro that will run each time the Page
selection changes in my Pivot Table to display a message box?

I basically want to remind them to copy a total amount to another sheet.

Many thanks
 
Use the WorksheetSelction Change event and check the target range....

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub

If this post helps click Yes
 
Hi thanks for your speedy reply.

My knowledge of VB is minimal. Can you give me a bit more guidance as to
what to put in the code please. I am a bit lost here sorry.
 
Assuming my Range as A1:C3 of Sheet1; copy the below code to the Selection
Change event. Launch VBE using Alt+F11 from workbook. From the left treeview
double click Sheet1(Sheet1) Drop down to get the 'Worksheet' 'Selection
Change' event paste the code...so as to look like.

Select any cell from A1:C3 in Sheet1...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Target, Range("$A$1:C$3")) Is Nothing Then
MsgBox "OK"
End If
End Sub

If this post helps click Yes
 
Back
Top