以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 按条件进行复制 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=123358) |
-- 作者:weibu -- 发布时间:2018/8/13 9:28:00 -- 按条件进行复制 咱们狐表自带的复制快捷菜单是点击单元格复制单元格内的值。 如何修改代码,复制表中的某一列时,不能复制最后一位字符。 例如:溯源码列,一单元格内数值“123456” 复制时仅能复制12345到粘贴板
|
-- 作者:有点甜 -- 发布时间:2018/8/13 9:35:00 -- Dim t As Table = CurrentTable Dim str As String = "" For i As Integer = t.Position To t.BottomPosition If t.Rows(i)("第一列") > "" Then str &= t.Rows(i)("第一列") & vbcrlf Else str &= vbcrlf End If Next msgbox(str) |
-- 作者:有点甜 -- 发布时间:2018/8/13 9:36:00 --
Dim str As String = "" For i As Integer = t.Position To t.BottomPosition Dim s As String = t.Rows(i)("第一列") If s > "" Then str &= s.SubString(0, s.length-1) & vbcrlf Else str &= vbcrlf End If Next msgbox(str) ClipBoard.SetText(str) |