Foxtable(狐表)用户栏目专家坐堂 → Excel单元格复制到Foxtable问题


  共有2408人关注过本帖树形打印复制链接

主题:Excel单元格复制到Foxtable问题

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/2/5 9:22:00 [显示全部帖子]

你表格keydown事件,写下面代码

 

If e.control = True AndAlso e.keycode = keys.v Then
    Dim str As String = ClipBoard.GetText
    Dim nstr As String = ""
    Dim tempstr As String = ""
    Dim flag As Boolean = False
    For i As Integer = 0 To str.length - 1
        If str(i) = """" Then
            If i = 0 OrElse str(i-1) = chr(9) OrElse str(i-1) = chr(10) Then '开始
                flag = True
            ElseIf i = str.length-1 OrElse str(i+1) = chr(9) OrElse str(i+1) = chr(13) Then '结束
                tempstr = tempstr.Replace(chr(13), "")
                nstr &= tempstr
                tempstr = ""
                flag = False
            End If
        End If
        If flag = True Then
            tempstr &= str(i)
        Else
            nstr &= str(i)
        End If
    Next
    ClipBoard.SetText(nstr)
End If


 回到顶部