if 某行某列为“否” then for i=0 to 总列数 -1 MSFlexGrid1.Col = i MSFlexGrid1.Row = 某行 MSFlexGrid1.CellBackColor = vbRed next end if
请看代码,是不是这样的?如果是。为什么我执行后背景色没变? debug.print "ok"测试已经执行过了。 For j = 0 To .rows - 1 .Col = 6 .Row = j If .Text = "False" Then .CellBackColor = vbRed Debug.Print "ok" End If Next
for i=0 to 总列数 -1
MSFlexGrid1.Col = i
MSFlexGrid1.Row = 某行
MSFlexGrid1.CellBackColor = vbRed
next
end if
debug.print "ok"测试已经执行过了。
For j = 0 To .rows - 1
.Col = 6
.Row = j
If .Text = "False" Then
.CellBackColor = vbRed
Debug.Print "ok"
End If
Next