–flexcpBackColor 背景色
cell(flexcpBackColor,row,col,row,col)=准则值
cell(准则,row,col,row,col)=准则值
eg:单元格1和2标记颜色
Cell(flexcpBackColor, 1, 1, 2, 2) = &HC0C0FF
当报表中第12列值为NO时,整行标红
If DataGrid.TextMatrix(DataGrid.Rows, 12) = "NO" Then
DataGrid.Cell(flexcpBackColor, DataGrid.Rows, 1, DataGrid.Rows, DataGrid.Cols) = &HC0C0FF
End If
当报表中第12列值为NO时,第2个单元格、第7个单元格标红
If DataGrid.TextMatrix(DataGrid.Rows, 12) = "NO" And
DataGrid.TextMatrix(DataGrid.Rows, 2) <> DataGrid.TextMatrix(DataGrid.Rows, 7) Then
DataGrid.Cell(flexcpBackColor, DataGrid.Rows, 2, DataGrid.Rows - 1, 2) = &HC0C0FF
DataGrid.Cell(flexcpBackColor, DataGrid.Rows, 7, DataGrid.Rows - 1, 7) = &HC0C0FF
End If
- 可以灵活使用一下cell(准则,row,col,row,col)=准则值中的 row,col,row,col;能做出多种效果。
- 可以搭配循环来使用
- 可以搭配某特定值时,加背景色,…