in vb.net i have datatable which the value from database here the format.
Is this possible when i want to make the style and color with the rules :
if nilai2 >= nilai1 then
hasil.backcolor = color.red
else if nilai2 < nilai1 then
hasil.backcolor = color.white
end if
Thanks before
I have get the answer. Here my code :
xlrange = sobjSheet.Range(columnName & "2:" & columnName & "" & dgvhasil.RowCount + 1)
With xlrange
.FormatConditions.Add(Excel.XlFormatConditionType.xlCellValue, Excel.XlFormatConditionOperator.xlLess, "0")
.FormatConditions(1).font.ColorIndex = 3
End With
Thanks for your attentions