Hi

1) Is the "selection" to be colored going to be rows, columns or both
2) Which column on Main contains the name?
3) Which column on Main contains the leave taken?
4) Is the "remainder" formula based and will process automatically, or does this have to be adjusted. If it has to be adjusted, then which column contains this number.

Perhaps a small example file showing your layout / relevant code would help.

rylo