Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer) bm = DataGrid1.Row k = DataGrid1.Columns.Count ReDim ss(k) '改这里 For ic = 0 To k - 1 DataGrid1.Row = bm DataGrid1.Col = ic ss(ic) = DataGrid1.Text MsgBox (ss(ic)) Next ic End Sub
bm = DataGrid1.Row
k = DataGrid1.Columns.Count
ReDim ss(k) '改这里
For ic = 0 To k - 1
DataGrid1.Row = bm
DataGrid1.Col = ic
ss(ic) = DataGrid1.Text
MsgBox (ss(ic))
Next ic
End Sub