Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default advancedfilter blowing up with runtime error 1004

Hi;

I have a workbook with two sheets: Data and Results. My search button on
the results sheet when pressed will see what criteria has been entered in the
criteria section of Results and then display matches in Data in the Result
section of the Result sheet. I have the following declarations:

Dim MaxResults As Integer, MyCol As Integer, ResultsRng As String
Dim MyRow As Integer, LastDataRow As Integer, DataRng As String
Dim CritRow As Integer, CritRng As String, RightCol As Integer
Dim TopRow As Integer, BottomRow As Integer, LeftCol As Integer

CritRng = "B3:I5" ' range of cells for Criteria table
ResultsRng = "B8:I8" ' range of headers for Results table

Towards the end of the code is the following line:

Worksheets("Data").Range(DataRng).AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range(CritRng), CopyToRange:=Range(ResultsRng), _
Unique:=False

When it tries to execute, I get the following error:

Run-time error '1004':
The extract range has a missing or illegal field name.

Is this extract range in the Results sheet (criteria or results section?) or
the Data sheet? Any help is appreciated.
--
JJFJR
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime error 1004 JR Excel Discussion (Misc queries) 2 November 21st 08 08:29 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Runtime error 1004 StephanieH Excel Programming 2 May 23rd 05 03:31 PM
Runtime error 1004 edreczk Excel Programming 1 November 4th 04 10:19 PM
Runtime Error 1004 Don[_7_] Excel Programming 2 September 16th 03 08:32 AM


All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"