以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  关于集合与日期列的判断  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=8733)

--  作者:狐哥
--  发布时间:2010/12/2 12:30:00
--  关于集合与日期列的判断

请教各位老师:

NA & "日期" 为日期列

NA 为逻辑列

 

 

Dim Names As String() = {"A","B","C","D","E","F","G","H","I","J","R","M","N","O","P","Q","L","S","T","U"}
Dim dr As Row = e.Row
For Each Na As String In Names
        If dr(na) = True Then
        dr(na & "日期") = Date.Today

这时并锁定对应的逻辑单元格.往下如何编辑?

       End If


Next

 

感谢各位老师.

 

   

[此贴子已经被作者于2010-12-2 12:30:51编辑过]

--  作者:czy
--  发布时间:2010/12/2 13:12:00
--  

锁定单元格?

直接在PrepareEdit事件中设置代码比较好。


--  作者:狐哥
--  发布时间:2010/12/2 14:24:00
--  

感谢CZY ,我试过,只是不知如何利用集合来控制:

 

Dim Names As String() = {"A","B","C","D","E","F","G","H","I","J","R","M","N","O","P","Q","L","S","T","U"}
Dim dr As Row = e.Row
For Each Na As String In Names
    If e.Col.Name = dr(na) AndAlso dr(na) = True Then
        e.Cancel = True
    End If
Next

 

这样试了不行,能否帮我看看。

 

 

不好意思,写错公式了。搞定了,

[此贴子已经被作者于2010-12-2 14:35:52编辑过]