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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -