Dim str As String
Dim dt As Date
For Each dr As DataRow In DataTables("表A").DataRows
dt=dr("日期")
If dt.Month = 6 Then
str=str & dr("_Identify") & "," '合并符合条件数据行的 _Identify
End If
Next
Tables("表A").Filter = "_Identify In (" & str.Trim(",") & ")"
利用 _Identify 对符合的数据进行筛选。
DON兄,你的代码过于繁杂了,新手可能看不懂。