Option Explicit
Sub HideRowFields()
Dim pt As PivotTable
Dim pf As PivotField
Set pt = ActiveSheet.PivotTables("PivotTable1")
For Each pf In pt.PivotFields
If pf.Orientation = xlRowField Then
pf.Orientation = xlHidden
End If
Next pf
Set pt = Nothing
Set pf = Nothing
End Sub