DataGridView复制到Excel格式
2021-01-13 23:14
标签:GridView div for cells color clipboard row grid val DataGridView复制到Excel格式 标签:GridView div for cells color clipboard row grid val 原文地址:https://www.cnblogs.com/rf8862/p/12275196.htmlClipboard.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
上一篇:DataGridView显示行号
下一篇:windows git
文章标题:DataGridView复制到Excel格式
文章链接:http://soscw.com/index.php/essay/41522.html