Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello All,
The following code runs slowly. Is there a better way to do this, perhaps with CountIf and Find? If there is even the smallest improvement from comparing every cell in the SearchRange with CompareValue, I'd love to hear the solution! Function AtLeastCells(CompareValue As Integer, SearchRange As Range) As Range 'Searches SearchRange for values that are greater than or equal to CompareValue 'of Integer Data Type. 'If values are found, all matching cells are returned. 'If no value is found, an empty range is returned. Dim rCell As Range For Each rCell In SearchRange.Cells If rCell.Value = CompareValue Then Set AtLeastCells = UnionWithNothing(rCell, AtLeastCells) End If Next rCell End Function I greatly appreciate any help. Thanks! Sisilla |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
COUNTIF greater than one column and less than another | Excel Worksheet Functions | |||
countif formula to find the occurances of a number that is greater than one number but less than another | Excel Discussion (Misc queries) | |||
countif greater/less than argument | Excel Worksheet Functions | |||
Using COUNTIF to find numbers within a range greater than the mean | Excel Worksheet Functions | |||
countif a date is greater than today | Excel Worksheet Functions |