以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]代码运行附加条件  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=91176)

--  作者:jyh7081
--  发布时间:2016/10/1 14:06:00
--  [求助]代码运行附加条件
下面是清除当前表所有空格的代码,想加上个条件:除“第二列“、“第三列”以外。
怎样改动代码?

For Each r As Row In CurrentTable.Rows
    For Each c As Col In CurrentTable.Cols
        If r.IsNull(c.Name) =  False AndAlso c.IsString Then r(c.Name) = r(c.Name).replace(" ","")
    Next
Next

[此贴子已经被作者于2016/10/1 14:07:01编辑过]

--  作者:狐狸爸爸
--  发布时间:2016/10/2 8:24:00
--  
For Each r As Row In CurrentTable.Rows
    For Each c As Col In CurrentTable.Cols
        if c.Name <> "第二列" And c.Name <> "第三列" Then
                   If r.IsNull(c.Name) =  False AndAlso c.IsString Then r(c.Name) = r(c.Name).replace(" ","")
        End If
    Next
Next