Tables("汇总表")怎么按照条件进行拆分 然后生成多个excel文件
当前代码:运行之后没有对应生成多个Excel文件
还有没有更好的办法呢?
Dim dlg As New FolderBrowserDialog
If dlg.ShowDialog = DialogResult.Ok Then
'Output.Show("你选择的目录是:" & dlg.SelectedPath,"提示")
Dim Products As List(Of String())
Products = DataTables("汇总表").GetValues("本方户名|本方卡号")
For Each Product As String() In Products
'Output.Show(Product(0))
Tables("汇总表").Filter="本方户名='" & Product(0) & "'and 本方卡号='" & Product(1) & "'"
Dim bb As Integer
bb= Tables("汇总表").Rows.Count
Tables("汇总表").SaveExcel(dlg.SelectedPath & "\" & Product(0) & "(" & Product(1) & ")共计" & bb &"笔.xls","汇总表")
output.show("已生成") 可弹出已生成
Tables("汇总表").Filter=""
Next
End If
[此贴子已经被作者于2022/3/22 11:17:57编辑过]