View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Four User Defined Functions - probably one similar answer

Hi,

These should do

Function kphmph(rng As Range)
kphmph = rng.Value * 0.62137119
End Function

Function mphkph(rng As Range)
mphkph = rng.Value * 1.609344
End Function

Function CF(rng As Range)
CF = (rng.Value * 1.8) + 32
End Function

Function FC(rng As Range)
FC = (rng.Value - 32) * 0.555556
End Function


Mike

"Paul Moles" wrote:

I want a set of "function" for convertions, eg if I enter =MPH() in a cell it
will assume the current value or referenced cell is KPH and will enter the
corrent MPH figure, conversely I would like to be able to do the reverse
=KPH(). Saves me having to enter conversion rate calculation each time. Also
would it be possible for =Centigrade() and =Farenheit(), although here the
conversion is more complex. (I generally use /5*9 +32).
Please advise whereabouts in the VBA these would need to be placed
Many Thanks
Paul