sql2 = "select * from jr order by 金额 asc "
Set rs = New ADODB.Recordset
rs.Open sql2, cn, adOpenForwardOnly, adLockOptimistic '____________将记录集内容显示到MSHFlexGrid1中______________
Set MSHFlexGrid1.Recordset = rs
MSHFlexGrid1.Refresh
rs.Close
cn.Close
想请教下如果金额为负的话变成蓝色要怎么改?
Set rs = New ADODB.Recordset
rs.Open sql2, cn, adOpenForwardOnly, adLockOptimistic '____________将记录集内容显示到MSHFlexGrid1中______________
Set MSHFlexGrid1.Recordset = rs
MSHFlexGrid1.Refresh
rs.Close
cn.Close
想请教下如果金额为负的话变成蓝色要怎么改?
with mshflexgrid
for i=1 to .rows-1
if .textmatrix(i,5)<>"" then
if cdbl(.textmatrix(i,5))<0 then
.row=i
.col=5
.cellbackcolor=vbred
end if
end if
next i
end with
.Recordset = rs
For i = 1 to .Rows-1
If Val(.textmatrix(i,5)) < 0 Then
.Row = i
.Col = 5
.CellForeColor = vbRed
End If
Next i
.Refresh
End With