xlwsheet.Cells(10, 2) = SearchedID.ToString
xlwsheet.Cells(11, 2) = Name.ToString
xlwsheet.Cells(12, 2) = ""
xlwsheet.Cells(13, 2) = BlckYr.ToString
For num1 = 0 To dgv1stSem.RowCount - 1
For num2 = 0 To dgv1stSem.ColumnCount - 1
For num3 = 1 To dgv1stSem.Columns.Count
Try
xlwsheet.Cells(17 + num1, 1 + num2) = dgv1stSem.Item(num2, num1).FormattedValue.ToString
Catch ex As Exception
End Try
Next
Next
Next
xlapp = Nothing
xlwbook = Nothing
End If
我正在尝试将4个datagridview导出为excel,但我只能传输1个datagridview,如何找到最后一个单元格和下一个空单元格以开始第二个datagridview的下一次传输?