excel - Change the color of the cell to red if the value in the Database is empty -
i have developed excel macros, fetches data database. want change color of cell if value in database empty. have code. below code not work.
if not rs.eof n = 0 rs.fields.count - 1 objsheet.cells(irow, icol).value = rs.fields.item(n) if ucase(rs.fields.item(n).name) = "order_status" if ucase(rs.fields.item(n)) = "" objsheet.cells(irow, icol).interior.colorindex = 3 else objsheet.cells(irow, icol).interior.colorindex = 4 end if end if
try same code in reverse..
if ucase(rs.fields.item(n)) <> "" objsheet.cells(irow, icol).interior.colorindex = 4 else objsheet.cells(irow, icol).interior.colorindex = 3 end if
hope :)
Comments
Post a Comment