crazyeyeschase
Board Regular
- Joined
- May 6, 2014
- Messages
- 104
- Office Version
- 365
- Platform
- Windows
I have a spreadsheet where i input PO information for multiple buildings. Some of these PO's have multiple line items which also get included in the sheet.
I am wanting to change the cell color of every other PO to help define each PO. Im not sure if conditional formatting would be best or a macro.
Something similar to below.
I was thinking the following but need some guidance if I'm heading in the right direction before writing the code.
If i have this correct this will check to see if the values are equal and if so it will then check to see the active cells interior color and change the offset cell and row to match
If the cells are not it will then determine the active cells color and change the offset to the opposite. to
I am wanting to change the cell color of every other PO to help define each PO. Im not sure if conditional formatting would be best or a macro.
Something similar to below.
PO |
12345678 |
12345678 |
12345679 |
12345680 |
12345681 |
I was thinking the following but need some guidance if I'm heading in the right direction before writing the code.
VBA Code:
For each cell in A to last row
If cell value = offset down 1 value then
if cell.interior color = white then
select range of cell and offset down 1 to column J and change interior color to white
else if cell.interior color = gray then
select range of cell and offset down 1 to column J and change interior color to gray
end if
elseif cell value <> offset down 1 value then
if cell.interior color = white then
select range of offset down 1 to column J and change interior color to gray
else if cell.interior color = gray then
select range of offset down 1 to column J and change interior color to white
end if
end if
next c
If i have this correct this will check to see if the values are equal and if so it will then check to see the active cells interior color and change the offset cell and row to match
If the cells are not it will then determine the active cells color and change the offset to the opposite. to