View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] rgablejr@gmail.com is offline
external usenet poster
 
Posts: 4
Default Advanced Filtering on an inactive sheet

On Apr 20, 3:48 pm, Spencer wrote:
i have a sheet that contains a database of products. Range("Products"). The
criteria range is above it ("FilterCriteria"). This sheet is not hidden, but
is not active. i have a userform with a combobox to choose a filter criteria
for the range. For some reason, when the sheet is not active, the filtering
does not work. so does the sheet need to be active or is there a workaround?
thanks.


Good evening Spencer,
You'll want to ensure the appropriate range names are used in the
advanced filter instead of cell references. For example,

Range("Products").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= Range("FilterCriteria"), Unique:=False

Using this technique, you will not have to select the worksheet
containing the database/criteria for the filter to work correctly.

Have a good weekend,

Ray R. Gable, Jr.