【发布时间】:2016-08-24 10:20:50
【问题描述】:
我想将特定行导出到多张 excel 表中,具体取决于 vb.net 中数据表中的日期
我的代码
我希望 17/08/2016 在一张纸上 18/08/2016 在下一张纸上。 我的表格行是这样的:
s.no date
1 17/08/2016
2 17/08/2016
3 17/08/2016
4 18/08/2016
5 18/08/2016
For i = 0 To dt.Rows.Count - 2
If dt.Rows(i).Item("AttDate") = dt.Rows(i + 1).Item("AttDate") Then
oSheet = oBook.Worksheets(1)
oSheet.Cells(Irow, IcolFranchisee) = dt.Rows(i).Item("Intime")
If dt.Rows(i).Item("latein") > 0 Then
oSheet.Cells(Irow, IcolFranchisee + 1) = dt.Rows(i).Item("latein")
Else
oSheet.Cells(Irow, IcolFranchisee + 2) = dt.Rows(i).Item("latein")
End If
Irow = Irow + 1
Else
osheet1 = oBook.Worksheets(2)
osheet1.Cells(Irow, IcolFranchisee) = dt.Rows(i).Item("Intime")
If dt.Rows(i).Item("latein") > 0 Then
osheet1.Cells(Irow, IcolFranchisee + 1) = dt.Rows(i).Item("latein")
Else
osheet1.Cells(Irow, IcolFranchisee + 2) = dt.Rows(i).Item("latein")
End If
Irow = Irow + 1
End If
Next
【问题讨论】:
-
有问题吗?
-
你能解释一下这个问题吗?
-
我有一组数据表中的行。在那个日期列中..我根据日期导出不同的工作表..
-
好的...您在导出到 excel 时遇到问题吗?
-
我知道怎么做单张