View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
El Cuarto Mago El Cuarto Mago is offline
external usenet poster
 
Posts: 1
Default Advanced filtering of Union of named Ranges

I'm closer using what was pasted below. However still getting an error
400. I think because the "TestTargetRange" appears to consist of ONLY
one cell even though when pasted into a worksheet (by naming a cell
via drop down window on worksheet) it pastes two columns and over 1300
rows. I'm thinking I'll next try to resize the range using offset or
resize. It sure would be nice if someone more knowledgable than I
would help out.

Dim rngToFilter As Range
Dim rngTargetRange As Range
Dim rngFilterCriteria As Range

Range("M1:M2").Name = "rngFilterCriteria"

Range("rngFilterCriteria").Cells(1).FormulaR1C1 =
"=""gctrDieCount.ACC"""
Range("rngFilterCriteria").Cells(2).FormulaR1C1 = "=""7"""

Union(Range("TestMaxCurrentDieTempValue"),
Range("TestDieCounterValue")).Copy _
Destination:=Range("TestTargetRange")

Range("TestTargetRange").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _ ' this is where it breaks. - error 400. that error
400 is so lame.
Range("rngFilterCriteria")