View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Ron[_28_] Ron[_28_] is offline
external usenet poster
 
Posts: 36
Default Custom Function behaviour?

"Bernard Liengme" wrote in
:

Hi Ron,
Now that problem is cleared up you might want to read VBA Help to learn
about the Select Case function - so much more elegant than a bunch of
ElseIf's

Bernard



Hi guys, thanks for the help & tuition.

Bernard, I knew there would be several ways to do this, but at my stage of
learning I was more familiar with the if/then statements.

I did try to get it all in a few lines by assigning variables to the
relevant values, but I got stuck on the fact that the fractions that were
being taken from the cell Q3 were formatted as text and I couldn't get them
to be read as a fraction, and then as a number in the variable.

I could do this by plonking the value of the fraction in a spare cell in
the sheet and then grabbing that for use in the function, but I'm at a loss
as to changing the format of a variable within the function, if this is at
all possible.

The above paragraph probably makes little sense to others who read this,
but I know what I'm on about ;)

Thanks guys,

Ron