excel - Put a fill color in a specific cell -


my program loops through each row of data in sheet. when errors, want put fill color on specific cell.

is there way put fill color in cell without using range?

 on error goto stop    'doing   exit sub stop: msgbox("error!")  'something fill cell sheets("data").cells(rowdata,1).color = red 

you can this

cells(rowindex, columnindex).interior.color = rgb-code  cells(rowindex, columnindex).interior.colorindex = indexno 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -