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

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
 
J

Jacob Skaria

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
 
M

Mustang

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.
 
J

Jacob Skaria

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top