-1
我似乎被困在什麼應該是一個基本問題。我正在嘗試將所有過濾器與VBA一起編碼。我對這種語言很陌生,我認爲我完全從Lynda.com上的一個文件中複製了這些內容,但我被卡住了。任何幫助都會很棒。當我嘗試運行一個宏時,我得到了一個錯誤。下一個沒有適用於VBA Excel
Dim pt As PivotTable
Application.ScreenUpdating = False
For Each pt In Active.Sheet.PivotTables
With pt.PivotFields("Parent Company")
.Orientation = xlPageField
.Position = 1
End With
With pt.PivotFields("Milestone")
.Orientation = xlPageField
.Position = 2
End With
With pt.PivotFields("Lead Status")
.Orientation = xlPageField
.Position = 3
End With
With pt.PivotFields("Lead Source")
.Orientation = xlPageField
.Position = 4
End With
With pt.PivotFields("Contact Owner:Full Name")
.Orientation = xlPageField
.Position = 5
With pt.PivotFields("Company: Company")
.Orientation = xlRowField
.Position = 1
End With
Next pt
Application.ScreenUpdating = True
End Sub
你缺少結束後,隨着= .POSITION 5 – Absinthe
多少'Withs'多少'結束Withs'你有嗎? – SJR
第一行應該是'Sub test()'或任何你想要的子程序名稱以匹配'End Sub' – SBF