最后合成筛选条件,如
Tables("表1").Filter = "id in ('a', 'b', 'c', 'd')"
完整代码
dim str as string = "'',"For Each r As Row In Tables("表2").GetCheckedRows str &= "'" & r("id") & "',"Nextmsgbox(str.trim(","))
Tables("表1").Filter = "id in (" & str.trim(",") & ")"