表名:水质类别转换
(实现:水质判断以颜色显示)
If e.Col.Name = "ph值" Then '如果是分组行的数量列
If e.Row("ph值") <= 9 And e.Row("ph值") >=6 Then
e.Style = "1类"
ElseIf e.Row("ph值") > 9 Or e.Row("ph值") < 6 And e.Row("ph值") > 0.001 Then
e.Style = "5类"
End If
End If
If e.Col.Name = "溶解氧" Then '如果是分组行的数量列
If e.Row("溶解氧") < 100 And e.Row("溶解氧") >=7.5 Then
e.Style = "1类"
ElseIf e.Row("溶解氧") >= 6 And e.Row("溶解氧") < 7.5 Then
e.Style = "2类"
ElseIf e.Row("溶解氧") >= 5 And e.Row("溶解氧") < 6 Then
e.Style = "3类"
ElseIf e.Row("溶解氧") >= 3 And e.Row("溶解氧") < 5 Then
e.Style = "4类"
ElseIf e.Row("溶解氧") >= 2 And e.Row("溶解氧") < 3 Then
e.Style = "5类"
ElseIf e.Row("溶解氧") >= 0.001 And e.Row("溶解氧") < 2 Then
e.Style = "劣5类"
End If
End If
If e.Col.Name = "高锰酸盐指数" Then '如果是分组行的数量列
If e.Row("高锰酸盐指数") >0.0001 And e.Row("高锰酸盐指数") <= 2 Then
e.Style = "1类"
ElseIf e.Row("高锰酸盐指数") > 2 And e.Row("高锰酸盐指数") < =4 Then
e.Style = "2类"
ElseIf e.Row("高锰酸盐指数") > 4 And e.Row("高锰酸盐指数") < =6 Then
e.Style = "3类"
ElseIf e.Row("高锰酸盐指数") > 6 And e.Row("高锰酸盐指数") < = 10 Then
e.Style = "4类"
ElseIf e.Row("高锰酸盐指数") > 10 And e.Row("高锰酸盐指数") <= 15 Then
e.Style = "5类"
ElseIf e.Row("高锰酸盐指数") >=15 And e.Row("高锰酸盐指数") < 100 Then
e.Style = "劣5类"
End If
End If
If e.Col.Name = "COD" Then '如果是分组行的数量列
If e.Row("COD") >0.0001 And e.Row("COD") <= 15 Then
e.Style = "1类"
ElseIf e.Row("COD") > 15 And e.Row("COD") < =20 Then
e.Style = "3类"
ElseIf e.Row("COD") > 20 And e.Row("COD") < = 30 Then
e.Style = "4类"
ElseIf e.Row("COD") > 30 And e.Row("COD") <= 40 Then
e.Style = "5类"
ElseIf e.Row("COD") >40 And e.Row("COD") < 100 Then
e.Style = "劣5类"
End If
End If
If e.Col.Name = "BOD5" Then '如果是分组行的数量列
If e.Row("BOD5") >0.0001 And e.Row("BOD5") <= 3 Then
e.Style = "1类"
ElseIf e.Row("BOD5") > 3 And e.Row("BOD5") < =4 Then
e.Style = "3类"
ElseIf e.Row("BOD5") > 4 And e.Row("BOD5") < = 6 Then
e.Style = "4类"
ElseIf e.Row("BOD5") > 6 And e.Row("BOD5") <= 10 Then
e.Style = "5类"
ElseIf e.Row("BOD5") >10 And e.Row("BOD5") < 100 Then
e.Style = "劣5类"
End If
End If
If e.Col.Name = "氨氮" Then '如果是分组行的数量列
If e.Row("氨氮") >0.0001 And e.Row("氨氮") <= 0.15 Then
e.Style = "1类"
ElseIf e.Row("氨氮") > 0.15 And e.Row("氨氮") < =0.5 Then
e.Style = "2类"
ElseIf e.Row("氨氮") > 0.5 And e.Row("氨氮") < =1 Then
e.Style = "3类"
ElseIf e.Row("氨氮") > 1 And e.Row("氨氮") < = 1.5 Then
e.Style = "4类"
ElseIf e.Row("氨氮") > 1.5 And e.Row("氨氮") <= 2 Then
e.Style = "5类"
ElseIf e.Row("氨氮") >2 And e.Row("氨氮") < 100 Then
e.Style = "劣5类"
End If
End If
If e.Col.Name = "P" Then '如果是分组行的数量列
If e.Row("P") >0.0001 And e.Row("P") <= 0.02 Then
e.Style = "1类"
ElseIf e.Row("P") > 0.02 And e.Row("P") < =0.1 Then
e.Style = "2类"
ElseIf e.Row("P") > 0.1 And e.Row("P") < =0.2 Then
e.Style = "3类"
ElseIf e.Row("P") > 0.2 And e.Row("P") < = 0.3 Then
e.Style = "4类"
ElseIf e.Row("P") > 0.3 And e.Row("P") <= 0.4 Then
e.Style = "5类"
ElseIf e.Row("P") > 0.4 And e.Row("P") < 5 Then
e.Style = "劣5类"
End If
End If
If e.Col.Name = "总氮" Then '如果是分组行的数量列
If e.Row("总氮") >0.0001 And e.Row("总氮") <= 0.2 Then
e.Style = "1类"
ElseIf e.Row("总氮") > 0.2 And e.Row("总氮") < =0.5 Then
e.Style = "2类"
ElseIf e.Row("总氮") > 0.5 And e.Row("总氮") < = 1 Then
e.Style = "3类"
ElseIf e.Row("总氮") > 1 And e.Row("总氮") < = 1.5 Then
e.Style = "4类"
ElseIf e.Row("总氮") > 1.5 And e.Row("总氮") <= 2 Then
e.Style = "5类"
ElseIf e.Row("总氮") > 2 And e.Row("总氮") < 5 Then
e.Style = "劣5类"
End If
End If
If e.Col.Name = "水质类别" Then '如果是分组行的数量列
If e.Row("水质类别") = 1 Then
e.Style = "1类"
ElseIf e.Row("水质类别") = 2 Then
e.Style = "2类"
ElseIf e.Row("水质类别") = 3 Then
e.Style = "3类"
ElseIf e.Row("水质类别") = 4 Then
e.Style = "4类"
ElseIf e.Row("水质类别") = 5 Then
e.Style = "5类"
ElseIf e.Row("水质类别") = 6 Then
e.Style = "劣5类"
End If
End If