Foxtable(狐表)用户栏目专家坐堂 → excel复制


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

主题:excel复制

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/7/1 11:35: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

 

http://foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=123061&skin=0

 


 回到顶部