Help with odd type mismatch error
Hi all:
I'm getting a type mismatch with the following code:
WorksheetFunction.Percentile(rngIn.Columns(Indx), _
CDbl(txtLowPercent.Value) / 100#)
rngIn is type Range and already set. txtLowPercent is a textbox on a
userform - this code in part of the userform code.
If I replace the CDbl() by a number like 95.0 then the code works fine. I
thought CDbl() should work in this situation since Percentile expects a
Double.
So, two questions. First, what's the problem here? Second, is there an
Application level function that replaces the worksheet function Percentile
that I should be using use?
I'm working in Excel 97 under Win98.
Thanks Tony (this is a great group - I wish I had something to offer besides
questions)
|