Style2.BackColor =Color.PaleGreen '格式背景颜色设为红色
Style3.BackColor =Color.PaleGreen '格式背景颜色设为红色
Style3.Font =new font("宋体", 10,FontStyle.Bold ) ''字体为宋体12加粗
Style3.BackColor =Color.LightGray '格式背景颜色设为红色
Style4.BackColor =Color.Azure '格式背景颜色设为红色
Style5.BackColor =Color.Azure '格式背景颜色设为红色
Style5.Format =("yyyy-MM-dd")''
For Each c As Col In dt.Cols
If c.visible Then i+=1
Next
For r As Integer = 0 To dt.Rows.Count '填入数据
If r Mod 2 =0 Then '如果是偶数行
For lzs As Integer = 0 To i-1 'dt.Cols.Count-5 '填入数据
Sheet( r+1 ,lzs ).Style =Style4 '设置单元格样式
Next
Sheet(r + 1,dt.Cols("支出金额").Index).Style = Style02 '设置折扣单元格的样式
Sheet(r + 1,dt.Cols("收入金额").Index).Style = Style12 '设置折扣单元格的样式
Sheet(r + 1,dt.Cols("记账日期").Index).Style = Style5 '设置折扣单元格的样式
Else
Sheet(r + 1,dt.Cols("支出金额").Index).Style = Style '设置折扣单元格的样式
Sheet(r + 1,dt.Cols("收入金额").Index).Style = Style1 '设置折扣单元格的样式
End If
Next