PC Review


Reply
Thread Tools Rate Thread

Advanced filtering of Union of named Ranges

 
 
El Cuarto Mago
Guest
Posts: n/a
 
      21st Nov 2007
First off, apologies if this has been discussed elsewhere. I've been
looking for two days w/o success. First, I'll describe what I'm trying
to acomplish, what I have done so far and what I came here to get help
on.

I have a large set of data (8 points sampled every 45mS for 10
minutes) collected from a machine and saved as CSV. I'm not sure what
the users of this data are looking to analyze or specifically
concerned about studying. Therefore I made the graph dynamic. Specific
sets (COLUMNS) of this data are being graphed. The Graph is
dynamically plotting Dynamic series achieved by using Names ranges for
start cell and the end cell is an offset from the start cell.
Example Series Source Data:
Name ="MaxCurrentDieTempValue"
Values ='Temp Analysis.xls'!MaxCurrentDieTempValue
where
MaxCurrentDieTempValue
=OFFSET(MaxCurrentDieTempValueStartCell,StartPosition,,Length,)

Name ="DieCounter"
Values ='Temp Analysis.xls'!DieCounter
where
DieCounter=OFFSET(DieCounterStartCell,StartPosition,,Length,)


Start Position and length are controlled by two slider bars. This is
great as it allows the user to essentially pan and zoom in to the
specific area of interest. I also give the user the Max, Min, Diff and
deviation.

HERE'S THE PROBLEM:
I want to create a subset of the above data to report on the
individual dies (DieCounter = 0, Die Counter = 1, etc etc). I
therefore tried to programatically run an advanced filter on the union
of the two ranges to output a range where die counter is equal to some
value. I figured I could then either graph the results and (again) do
the Max, Min, Diff and stddev of the individual and compare it to the
overall.

I CAN'T GET THE FILTER TO WORK. Here's what I have

Sub Macro1()
Dim rngToFilter As Range
Dim rngTargetRange As Range

Worksheets("Graph Sheet").Activate

Set rngToFilter =
Application.Union(Range("MaxCurrentDieTempValue"),
Range("DieCounter"))

rngToFilter.AdvancedFilter _
Action:=xlFilterCopy, _
CriteriaRange:=Worksheets("Graph Sheet").Range("G1:G2"), _
CopyToRange:=Range(rngTargetRange), _
Unique:=False

End Sub

WHERE CELL "G1" of "Graph Sheet" CONTAINS A "0". I should then be able
to create a graph series out of rngTargetRange and get the MIN, MAX,
etc, etc.

This seems like the right approach but I keep getting error 400.

Someone please help me.


 
Reply With Quote
 
 
 
 
El Cuarto Mago
Guest
Posts: n/a
 
      27th Nov 2007
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")

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Advanced Filter - Named Ranges Bull Microsoft Excel Worksheet Functions 1 30th Apr 2009 05:04 AM
Advanced Filter - Named Ranges Bull Microsoft Excel Programming 0 29th Apr 2009 08:01 PM
Advanced Filter with Union of Ranges =?Utf-8?B?Sm9obg==?= Microsoft Excel Programming 1 3rd Mar 2007 07:41 PM
union of named ranges based only on the names of those ranges sloth Microsoft Excel Programming 3 2nd Oct 2006 03:18 AM
using named ranges and copy with Advanced Filter Marcia Microsoft Excel Worksheet Functions 4 12th May 2004 02:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:24 AM.