以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  想标识列的数据  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=185008)

--  作者:阳光自我灿烂
--  发布时间:2023/1/30 11:26:00
--  想标识列的数据

\'如果是数值型列,且不是总分列
If
e.Col.IsNumeric AndAlso e.Col.Name <> "总分" Then
    If
e.Row.IsNull(e.Col.Name) = False \'且该列已经输入内容
       
If e.Row(e.Col.Name) < 60 Then \'如果该列的值小于60
            e.Style =
"不及格" \'那么用"不及格"样式绘制单元格
       
ElseIf e.Row(e.Col.Name) > 95 Then \'如果单元格的值大于95
            e.Style =
"优秀" \'那么用"优秀"样式绘制单元格
       
End If
    End
If
End
If

这个是标识表的数据,我想标识其中一列,如何标识?


--  作者:有点蓝
--  发布时间:2023/1/30 11:35:00
--  
If e.Col.Name = "某列" Then
  
e.Style = "某样式"
End
 
If
--  作者:阳光自我灿烂
--  发布时间:2023/1/30 11:50:00
--  
OK
--  作者:阳光自我灿烂
--  发布时间:2023/1/30 11:59:00
--  
图片点击可在新窗口打开查看
输入偏高或偏低数据时,没有按标识的颜色变化?

--  作者:有点蓝
--  发布时间:2023/1/30 12:02:00
--  
哦,应该是我理解错了。

1楼的代码
If e.Col.IsNumeric AndAlso e.Col.Name <> "总分" Then
改为
If e.Col.IsNumeric AndAlso e.Col.Name = "某列" Then

其它代码不变

--  作者:阳光自我灿烂
--  发布时间:2023/1/30 12:07:00
--  
If e.Col.Name = "温度" Then
    If e.Row(e.Col.Name) < 19 Then 
        e.Style = "偏低" 
    ElseIf e.Row(e.Col.Name) > 21 Then 
        e.Style = "偏高" 
    End If
End If
输入小于19或大于21时,数据列没有标识?

--  作者:阳光自我灿烂
--  发布时间:2023/1/30 12:10:00
--  
If e.Col.Name = "温度" Then
    If e.Col.Name < 19 Then 
        e.Style = "偏低" 
    ElseIf e.Col.Name > 21 Then 
        e.Style = "偏高" 
    End If
End If
输入小于19或大于21时,数据列没有按单元格的要求进行标识?

--  作者:阳光自我灿烂
--  发布时间:2023/1/30 12:21:00
--  
解决了!谢谢!