LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default AutoFilter and copy

I am using Excel 97.

I want to accomplish the following. I want to set a filter then copy
the filtered data to the next available empty cell in the new report.
The code looks something like this.

Dim rngSource As Range, rngDestination As Range

Cells.Select
Selection.AutoFilter
Selection.AutoFilter Field:=41, Criteria1:="FB"
Set rngSource = ActiveWorkbook.Cells.SpecialCells(xlCellTypeVisibl e).Copy
<- Crashes here on specialcells.
wbNew.Activate
Set rngDestination = ActiveWorkbook.Range(lcCell)
rngSource.Copy rngDestination

The help file says that specialcells returns a range. But I can not
seem to assign the filtered data to a range.

How can I do the above?
 
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
Insert Row/Copy with Autofilter lilbit3684 Excel Discussion (Misc queries) 4 April 3rd 07 11:17 PM
Autofilter - copy & paste Dorothy Excel Worksheet Functions 0 May 29th 06 10:56 PM
Copy/Paste in Autofilter honyacker Excel Discussion (Misc queries) 2 January 12th 06 02:38 PM
Copy error with Autofilter Jonathan May[_3_] Excel Programming 0 July 15th 04 01:43 PM
Copy an autofilter range pauluk[_13_] Excel Programming 2 March 4th 04 04:28 PM


All times are GMT +1. The time now is 12:31 PM.

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

About Us

"It's about Microsoft Excel"