Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks to Tom, Bob, and Mark for your responses. I had forgotten about the
application.volatile issue, so I went ahead and decided to pass the source ranges directly. Here's the final product, in case anyone is interested :) Keith R XL97 ================================================== ====== Public Function Consolidated(SC1 As Range, SC2 As Range, SC3 As Range, _ SC4 As Range, SC5 As Range, SC6 As Range, SC7 As Range) As Variant 'each input range will be a single cell Dim i As Long Dim ws As Range Dim TotalValue As Double Dim DivCount As Double For i = 1 To 7 Set ws = (Choose(i, SC1, SC2, SC3, SC4, SC5, SC6, SC7)) If Not IsError(ws.Value) Then If Not IsEmpty(ws.Value) Then If IsNumeric(ws.Value) Then TotalValue = TotalValue + ws.Value DivCount = DivCount + 1 End If End If End If Next If DivCount 0 Then Consolidated = TotalValue / DivCount Else Consolidated = CVErr(xlErrNA) End If End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Tab keeps cycling through the same row | Excel Discussion (Misc queries) | |||
Cycling through workbooks | Excel Discussion (Misc queries) | |||
Pivot Table Cycling Through Page Fields Automatically | Excel Discussion (Misc queries) | |||
Anyone out there knows of running cycling and swimming logs? | Excel Discussion (Misc queries) | |||
.Visible Property | Excel Programming |