View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Corey Corey is offline
external usenet poster
 
Posts: 276
Default Code to replace Formula

Thanks for the reply James.
I managed to enter the code with no problems.

However i get a result initially, but if i change one of the cell values in
the worksheet the CODED CELL Value does not change.

I changed the Code name and modified it a bit to suit as below:

Function TravelOT()
If [c5] = "Appin" Or [c5] = "Douglas" Or [c5] = "Metro" And [c7] < [v2]
And [c8] <= [w2] Then
TravelOT = "0.75"
ElseIf [c5] = "Appin" Or [c5] = "Douglas" Or [c5] = "Metro" And [c7] <
[v2] And [c8] [w2] Then
TravelOT = "1.5"
ElseIf [c5] = "Delta" And [c7] < [v2] And [c8] <= [w2] Then
TravelOT = "0.5"
ElseIf [c5] = "Delta" And [c7] < [v2] And [c8] [w2] Then
TravelOT = "1"
Else: TravelOT = "0"
End If
End Function

Does it need a REFRESH step??

Is it possible to have MANY(50) Coded Formulas in Cells, in a single sheet?
I tried another code as below but the cell would not allow me to plave it
without an error"THAT NAME IS NOT VALID"???
Although the name i was using was in the same Module as the TravelOT code as
below:

Sub Normal_Time()
If [c5] = "Non U/G" And ([c7] = [v2] And [c8] = [w2]) * "24" Then
Normal_Time = "8"
Else: Normal_Time = "0"
' =IF(AND(C5="Non U/G"),C8-C7,"0")*(24) <====== Original Formula used, but
Now to be CODED
End Sub



Am i doing something wrong here?

--
Regards

Corey