以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]单元格内多行去重  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=124012)

--  作者:jyh7081
--  发布时间:2018/8/28 22:05:00
--  [求助]单元格内多行去重
单元格内容如下:
AAA
AAA
BBB
BBB
CCC

怎样变为:
AAA
BBB
CCC

请老师帮助,谢谢!
Dim s As String = e.DataRow("姓名")
    If s <>"" Then
        s = s.replace(vbcrlf, vblf)
        Dim ss() As String = s.split(vblf)
        ....
    
End If




--  作者:有点蓝
--  发布时间:2018/8/28 22:15:00
--  
If e.DataRow.Isnull("姓名") = False Then
    Dim lst As  List(of String) = e.DataRow.Lines("姓名")
    Dim lst2 As new List(of String)
    For Each s As String In lst
        If lst2.Contains(s) = False Then
            lst2.Add(s)
        End If
    Next
    e.DataRow.Lines("姓名") = lst2
End If