I think he is looking for a VBA function like SUMIF or COUNTIF but returning the entire input range with some cells blanked out (thereby filtering the input values based on a condition) You can do this with an array formula using built in functions.
Assuming your input range is A1:C10, highlight D1:F10, enter =IF(A1:C10>5,A1:C10,"") and press control-shift-enter instead of just enter. That gets you an array formula with the same size output range as the input range.
Now, assuming that is the kind of thing you want to do except you want a macro that does it so you can do something more intelligent, you can use the following:
Assuming your input range is A1:C10, then to use this macro highlight D1:F10, enter =FilterMacro(A1:C10,">",5,"") and press control-shift-enter instead of just enter. That gets you an array formula with the same size output range as the input range.
Public Function FilterMacro(ByRef InputValues As Range, Operation As String, ConditionValue As Variant, EmptyValue As Variant) As Variant
Dim Result As Variant
Dim MatchesFilter As Boolean
Result = InputValues.Value2
For CurrentRow = 1 To InputValues.Rows.Count
For CurrentColumn = 1 To InputValues.Columns.Count
Select Case Operation
Case ">": MatchesFilter = InputValues(CurrentRow, CurrentColumn) > ConditionValue
Case "<": MatchesFilter = InputValues(CurrentRow, CurrentColumn) < ConditionValue
Case "<>": MatchesFilter = InputValues(CurrentRow, CurrentColumn) <> ConditionValue
Case "=": MatchesFilter = InputValues(CurrentRow, CurrentColumn) = ConditionValue
End Select
If Not MatchesFilter Then
Result(CurrentRow, CurrentColumn) = EmptyValue
End If
Next
Next
FilterMacro = Result
End Function
Sorry it doesn't fit on the screen so well. Perhaps I should have used shorter variable names...