gd1sum8nfg2
New Member
- Joined
- Aug 30, 2014
- Messages
- 6
Hello,
I'm looking for some VBA interior.color help. I have a column, with different values. What I want to happen is that, for instance, I have column with with say 15 rows worth of data. Say these values do not deviate, very much, from row to row. I want a vba code to set the interior color of the target cell to a color, whether red, blue, green, if the target cell is different than the one above it. So if, all in column "A", rows 1,2,3,4 are all "1" and then row "5" is 2, I want only row 5 to turn a different color. and if row 6 is also "2" then no color change. Thanks in advance!
P.S. so far my code looks something like this.
if target.column = 1 then
if target.cell<> target.offset (0,1) then
target.cell.interior.color= vbgreen
end if
end if
end sub
I'm looking for some VBA interior.color help. I have a column, with different values. What I want to happen is that, for instance, I have column with with say 15 rows worth of data. Say these values do not deviate, very much, from row to row. I want a vba code to set the interior color of the target cell to a color, whether red, blue, green, if the target cell is different than the one above it. So if, all in column "A", rows 1,2,3,4 are all "1" and then row "5" is 2, I want only row 5 to turn a different color. and if row 6 is also "2" then no color change. Thanks in advance!
P.S. so far my code looks something like this.
if target.column = 1 then
if target.cell<> target.offset (0,1) then
target.cell.interior.color= vbgreen
end if
end if
end sub