利用系统对象ClipBoard的GetText()方法获取剪切板中的内容,然后解析字符串Private Sub Form_Load() Dim strData As String Dim strRows() As String Dim strCols() As String Dim i As Long, j As Long
For i = LBound(strRows) To UBound(strRows) strCols = Split(strRows(i), Chr(9)) '分解每列 For j = LBound(strCols) To UBound(strCols) Debug.Print "(" & i & ":" & j; ")" & strCols(j) Next Next End Sub
Dim strData As String
Dim strRows() As String
Dim strCols() As String
Dim i As Long, j As Long
strData = Clipboard.GetText '获取剪切板数据
strRows = Split(strData, vbCrLf) '分解行
For i = LBound(strRows) To UBound(strRows)
strCols = Split(strRows(i), Chr(9)) '分解每列
For j = LBound(strCols) To UBound(strCols)
Debug.Print "(" & i & ":" & j; ")" & strCols(j)
Next
Next
End Sub