VBA Pivot Table Change Sync

ManUBlueJay

Active Member
Joined
Aug 30, 2012
Messages
302
Office Version
  1. 2016
Platform
  1. Windows
I am stumped with this code I am trying to run. It loops back 3 times without any pivot table change. The SetupMDL does not involve a pivot table. Range ("Date") fires up a calendar but not associated with a pivot table.
I removed the date and the SetupMDL to see if one of these cause the loop but it still circles back 3 times. Which means I have to enter the Date 3 times before it sticks. The code works fine if the first and second ifsis tru

VBA Code:
Private Sub Worksheet_PivotTableChangeSync(ByVal Target As PivotTable)
Application.EnableEvents = False
Worksheets("Hof List").Unprotect
Worksheets("Distribution").Unprotect

If Range("MDL_MTSelection").Value = "Type1" Then
SetUpMDL
ShowNewForm
Else
If Range("MDL_MTSelection").Value = "(All)" Then
SetUpMDL
Else
If Range("MDL_MTSelection").Value <> "(All)" Then
SetUpMDL
Application.EnableEvents = True
Range("Date").Select
Exit Sub
End If
End If
End If[
End Sub/CODE]
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,213,536
Messages
6,114,215
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top