ManUBlueJay
Active Member
- Joined
- Aug 30, 2012
- Messages
- 302
- Office Version
- 2016
- Platform
- 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
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]