View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Alvin Alvin is offline
external usenet poster
 
Posts: 19
Default Custom function - Help please

you didn't specify the row reference.
Range(Requispour.Column + 1).Interior.ColorIndex = 55

try:
Requispour.Offset(0,1).Interior.ColorIndex = 55

" wrote:

Hello,

I created this function but I don't know why it doesn't work properly.
Any help appreciate.
Thank you.

Regards,
Thierry

Function Tps(Livrele As Range, Requispour As Range)
Dim Delay As Integer
Delay = Range(Requispour).Value - Range(Livrele).Value
If Delay < 0 Then
Range(Requispour.Column + 1).Interior.ColorIndex = 55
Range(Requispour.Column + 1).Font.ColorIndex = 0
Else
Range(Requispour.Column + 1).Interior.ColorIndex = 0
Range(Requispour.Column + 1).Font.ColorIndex = 1
End If
End Function