Changing font colour in a range based on conditions in another

Many thanks for the answer provided so far. But what I actually want have not been solved. For example if any cell value in the range D4:D40 is between 1-10, change the corresponding cell in B4:B40 to red. Even though B4:B40 is text and D4:D40 is numbers/values.

Many thanks for your informed reaponses