View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default excel vba - filters and ranges

So the issue is that you are inserting rows and moving your criteria range
every time you insert rows? I assume you are also having an issue in that the
paste area needs to be incremented as you insert rows? It is a little hard to
tell from your post...
--
HTH...

Jim Thomlinson


" wrote:

I have a list of transactions to which I add records daily. I want to
to filter and extract records to another location on the spreadsheet
based on user defined criteria. My problem is that the code initially
selects the correct range but range references for the filter do not
appear to change as records are not does the range for filter critieria
adjust to reflect the addition of records. Obviously I am new to VBA
but help would be appreciated.

File format
Date CP Notional Cur Type Rate
28-Jul-06 RBC 1,972,950 EUR SWAP 1.4360
28-Jul-06 BNS 1,500,000 USD FWD 1.1250


Filter Criteria
Date CP
28-Jul-06 RBC


Code
Sub Macro1()
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range("A1:I4").AdvancedFilter Action:=xlFilterCopy,
CriteriaRange:=Range( _"A7:C8"), CopyToRange:=Range("A10"),
unique:=False
End Sub