Clipboard.Clear() ' 清除剪贴板 If DataGridView2.Rows.Count > 0 Then Dim a As New List(Of String) For i As Integer = 0 To DataGridView2.Rows.Count - 1 Dim b(DataGridView2.Columns.Count - 3) As String For j As Integer = 1 To DataGridView2.Columns.Count - 2 b(j - 1) = DataGridView2.Rows(i).Cells(j).Value Next a.Add(String.Join(vbTab, b)) Next Clipboard.SetText(String.Join(vbCrLf, a.ToArray)) a = Nothing End If