Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT.. How to select a range 1

Status
Not open for further replies.

bompa

Programmer
Mar 20, 2002
4
FI
Hello Are in need for help with VBA for Excel 2002 (xp)
The problem is the following varStock and varMarket selects a number of cells.
However they doesn´t do that WHY?

Public Function CAPMBeta(varstock As Range, varMarket As Range) As Double

varVarians = Application.WorksheetFunction.Varians(varstock)
varCovarians = Application.WorksheetFunction.Kovarvarstock, varMarket)

CAPMBeta = CAPMBeta & varVarians / varCovarians
End Function

 
does this help ?

Public Function tstme(varstock As Range, varmarket As Range)


For Each Var In varstock
a = a + Var.Value
Next
For Each Var In varmarket
b = b + Var.Value
Next

tstme = a / b

End Function

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top