![](/img/trans.png)
[英]VBA Instr function is not finding the substring from the position mentioned from all the sheets in workbook and deleting only from one Visible sheet
[英]VBA to refresh all sheets in a workbook excluding only one Sheet
示例標題您好,我的工作簿的 6 張工作簿中有 6 張數據透視表,其中一張(已排序)具有按特定順序排列的列,但沒有數據透視表。 我只想用 Pivot 刷新工作表。 我使用了下面的 VBA,但它重新排列了排序工作表中的列。 下面是代碼
Sub RefreshAllPivotTables()
Dim PT As PivotTable
Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
For Each PT In WS.PivotTables
PT.RefreshTable
Next PT
Next WS
End Sub
這是排除一張紙的一種可能方法:
Sub RefreshAllPivotTables()
Dim PT As PivotTable
Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
If WS.Name <> "Sorted" Then
For Each PT In WS.PivotTables
PT.RefreshTable
Next PT
End If
Next WS
End Sub
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.