View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
MSP77079[_28_] MSP77079[_28_] is offline
external usenet poster
 
Posts: 1
Default Possible array formula?

I would use AutoFilter. Below is an example. Perhaps not the mos
elegant solution, but you should get the idea.

I took your table and pasted it into the range "B4:H17". Obviously yo
will not want this hard coded. If you have any problems getting thi
to be a variable range, post again.


If ActiveSheet.FilterMode = True Then ActiveSheet.ShowAllData
If ActiveSheet.AutoFilterMode = True The
ActiveSheet.AutoFilterMode = False

Range("B4:H17").Select
Selection.Sort Key1:=Range("B5"), Order1:=xlAscending
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
_
DataOption1:=xlSortNormal
Selection.AutoFilter
Selection.AutoFilter Field:=7, Criteria1:="Open"
Selection.AutoFilter Field:=5, Criteria1:="103.53125"
LastRow = Range("B4").End(xlDown).Row
Set myRange = Range("B4:B" & LastRow)
Viz = 0
On Error Resume Next
Viz = myRange.SpecialCells(xlCellTypeVisible).Count
If Viz 0 Then
For i = 5 To LastRow
If Cells(i, "B").EntireRow.Hidden = False Then
MsgBox "The item you seek is " & Cells(i, "B")
Exit Sub
End If
Next i
Else:
MsgBox "There were no records that matched your selectio
criteria."
End I

--
Message posted from http://www.ExcelForum.com