View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
sebastienm sebastienm is offline
external usenet poster
 
Posts: 694
Default How to turn off dragging for a Pivot Table field

Hi,
Not sure what you mean by drag off.

You can freeze a field using the below function PivotFieldFreeze.
Pivot freeze would have to be called on each field.

Sub test()
Dim pf As PivotField
Set pf = ActiveSheet.PivotTables(1).PivotFields("A") '<--- change field
name here
PivotFieldFreeze pf
End Sub

Function PivotFieldFreeze(PivotField As PivotField)
With PivotField
.DragToColumn = False
.DragToData = False
.DragToHide = False
.DragToPage = False
.DragToRow = False
End With
End Function

"Prabhakar" wrote:

Hi,
Is there a way to turn off dragging for a Pivot Table.

thanks
prabhakar