Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
worksheet function with two ranges
I want to calculate the stdev of (colA - colB) in VBA code without
creating a new column. My attempted code below gives me a type mismatch. Does anyone know how I would do it? Public Sub calcStdev() Dim myRangeAct As Range Dim myRangeMod As Range Set myRangeAct = Range(Cells(1, 1), Cells(100, 1)) Set myRangeMod = Range(Cells(1, 2), Cells(100, 2)) Debug.Print Application.WorksheetFunction.StDevP(myRangeAct) Debug.Print Application.WorksheetFunction.StDevP(myRangeMod) 'GET TYPE MISMATCH Debug.Print Application.WorksheetFunction.StDevP(myRangeAct - myRangeMod) End Sub Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IF Function with different ranges. | Excel Discussion (Misc queries) | |||
Sum over ranges on another worksheet | Excel Worksheet Functions | |||
Copy Worksheet plus ranges | Excel Programming | |||
Vlookup with 2 ranges in one worksheet | Excel Worksheet Functions | |||
How to loop through all ranges in a worksheet | Excel Programming |