--
cnt = 0
Dim Sheet3 As XLS.Sheet = Book.Sheets(18)
Dim hdr3 As Integer = dt3.HeaderRows
dt3.CreateSheetHeader(Sheet3,0,1)
Sheet3.Cols.Frozen = 3
Sheet3.Rows.Frozen = 1
For c As Integer = 0 To dt3.Cols.Count -1
If dt3.Cols(c).Visible Then
For r As Integer = 0 To dt3.Rows.Count(True) - 1
if dt3.rows(r,True).isnull(c) = false
Sheet3(r + hdr3,cnt+1).value = dt3.rows(r,True)(c)
endif
Next
cnt = cnt + 1
End If
If dt3.Cols(c).name ="关店日期" Then
Sheet3(i,c+1).Style = Style99
else
Sheet3(0, c+1).Style = Style
Sheet3(1, c+1).Style = Style
endif
If dt3.Cols(c).Caption <> "月份" And dt3.Cols(c).Caption <> "事业部" And dt3.Cols(c).Caption <> "部门名称" Then
Sheet3.Cols(c+1).Width = 120
End If
Sheet3.Cols(1).Width = 240
Sheet3.Cols(3).Width = 60
Next
去掉后面的
For i As Integer = 0 To dt3.Rows.count - 1
Dim d1 As Date
d1 = #01/01/2000#
If dt3.Rows(i)("关店日期")>d1 Then
Sheet3(i,dt3.Cols("关店日期").Index+1).Style = Style99
End If
Next