# Excel Macro Filtered Visible Cells

Q

#### QTE

Data is filtered in-place: I then need to perform a calculation on th
Visible Filtered cells using the Frequency function. My code return
the values for the whole list, instead of just the Filtered Visibl
cells of the Frequency Results(Freq_Results).

Freq_Results=Named Range of All Unfiltered Frequency Results, the
filtered in_place

Frequencies=Named Range Number of Times

Bins=Named Range of Intervals

Range("Freq_Results").SpecialCells(xlVisible).Select
Range("Frequencies").Select
Selection.FormulaArray = ("=Frequency(Freq_Results,Bins)")

Excel Help -
Frequency Function Overview:
Returns a frequency distribution as a vertical array. For a given se
of values and a given set of bins (or intervals), a frequenc
distribution counts how many of the values occur in each interval.

Syntax:

FREQUENCY(data_array, bins_array)

Data_array is an array of or reference to a set of values for whic
you want to count frequencies. If data_array contains no values
FREQUENCY returns an array of zeros.
Bins_array is an array of or reference to intervals into which yo
want to group the values in data_array. If bins_array contains n
values, FREQUENCY returns the number of elements in data_array.

Remarks

FREQUENCY is entered as an array formula after selecting a range o
adjacent cells into which you want the returned distribution t
appear.
The number of elements in the returned array is one more than th
number of elements in bins_array.
FREQUENCY ignores blank cells and text.
Formulas that return arrays must be entered as array formulas

J

#### Jim Rech

Except for the SubTotal function all Excel worksheet functions are oblivious
to whether rows are hidden in the source range. Given that, maybe you can
use the Data, Filter, Advanced Filter option to create an output list of
just the matching records in a different location, and then do a Frequency
on that list.