--
Dim t As Integer
For t = 0 To dt.DataRows.Count -1
If dt.DataRows(t)("日期") <> #01/01/0001# Then
Sheet(t + 1,0).Value = Format(dt.DataRows(t)("日期"),"yyyy年MM月dd日")
End If
Sheet(t + 1,1).Value = dt.DataRows(t)("单号")
Sheet(t + 1,2).Value = dt.DataRows(t)("产品名称")
Sheet(t + 1,3).Value = Format(dt.DataRows(t)("数量"),"0.00") & "公斤"
Sheet(t + 1,4).Value = Format(dt.DataRows(t)("单价"),"0.00")
Sheet(t + 1,5).Value = "¥" & Format(dt.DataRows(t)("金额"),"#,###.00")
Next
Sheet(t + 1,0).Value = "合计"
Sheet(t + 1,3).Value = dt.Compute("sum(数量)") & "公斤"
Sheet(t + 1,5).Value = "¥" & Format(dt.Compute("sum(金额)"),"#,###.00")