以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  列拆分  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=195636)

--  作者:fangshen
--  发布时间:2025/2/25 9:22:00
--  列拆分
各位大侠:我希望实现如下功能

在”表“,有A列,B列,C列,D列,希望把   A列  的字符根据   |   拆分到B列,C列,D列
例子:A列  的内容   中国|上海|青浦
        希望拆分成   B列=中国,C列=上海,D列=青浦

谢谢

--  作者:有点蓝
--  发布时间:2025/2/25 9:43:00
--  
http://www.foxtable.com/webhelp/topics/0625.htm

DataColChanged事件
If e.DataCol.Name = "A列" Then
    
If e.NewValue > "" Then 
      dim ss() as string = 
e.NewValue.split("|") \'http://www.foxtable.com/webhelp/topics/0245.htm
 e.DataRow("B列") = ss(0)
if ss.length > 1 then
 e.DataRow("C列") = ss(1)
end if
if ss.length > 2 then
 e.DataRow("D") = ss(2)
end if
    
End If
End
 
If

已有数据在输入表事件代码后,重置一下A列
[此贴子已经被作者于2025/2/25 9:43:42编辑过]