Welcome to ExcelFox

Please wrap your codes with proper code tags. Instructions are clearly given.

Try this

Code:
Sub ExcelFox()

    Dim fld As PivotField
    For Each fld In ActiveSheet.PivotTables("SelectedDataPivot").PivotFields
        fld.Subtotals(1) = False
    Next fld
    
End Sub