Using a variable in a formula
Where are you defining "MarketValues"?
Is MarketValues a named range that is the same as population? If so, this
seemed to work for me:
Sub test()
Dim Population As Range
Set Population = Range("A1", Range("A1").End(xlDown))
Application.Names.Add Name:="Marketvalues", _
RefersTo:=Population
Range("B1").Formula = "=PERCENTILE(MarketValues,0.2)"
End Sub
"Noah" wrote:
I have defined this range:
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Dim Population As Range
Set Population = Selection
And then I want to use this range in the percentile function, but I haven't
been able to figure it out:
Range("B1").Select
ActiveCell.Formula = "=PERCENTILE(MarketValues,0.2)"
Any help would be greatly appreciated. Thanks.
Noah
|