我正在尝试计算名称相似的工作表的数量(例如所有以“East”开头的)。
这是我用来计算床单的代码:
Dim wb As Workbook
Dim ws As Worksheet
Dim myTotal As Long
Dim wsTotal As Long
For Each wb In Workbooks
For Each ws In Worksheets
If ws.Name Like "20 Out of Court" & "*" Then myTotal = myTotal + 1
Next ws
Next wb
wsTotal = myTotal
有时它会使某些机器上的工作表总数翻倍。