我很想知道为什么这段代码将值5放在列单元格
中 For Each row As DataGridViewRow In Me.datagridADRORD.Rows
row.Cells("Historical Diff").Value = 5
Next
但是这段代码不起作用,即单元格留空。公式单元格中有值,因此应该有一个值放在计算列
中 For Each row As DataGridViewRow In Me.datagridADRORD.Rows
row.Cells("Historical Diff").Value = row.Cells("ADR Price").Value - row.Cells("ORD Price").Value
Next
答案 0 :(得分:0)
请尝试Cell索引,而不是Cell Name。
// 1是单元格索引
row.Cells(1).Value = 5