Dim str As String = "A单位,8月"
If InputValue(str, "提示", "请输入:") Then
Dim ary() As String = str.split(",")
If ary.length = 2 Then
Tables("表A").Filter = "第一列 = '" & ary(0) & "' and 第二列 = '" & ary(1) & "'"
Dim Book As New
XLS.Book(ProjectPath
&
"Attachments\测试.xls") '打开模板
Dim fl As String = ProjectPath
&
"Reports\测试.xls"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Sheet(3,9).Value = "<日期 = # "
&
Date.Today
&
"#>" '写入打印条件
Book.Build()
'生成报表
Book.Save(fl)
Dim Proc As
New
Process
Proc.File =
fl
Proc.Start()
就是Sheet(3,9).Value = "<日期 = # " & Date.Today & "#>" 这行代码如何改写同时满足月份和单位,因为表A中月份和单位不是放在第一列和第二列的。