Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Copying filtered data

Hi,

This is very much a work in progress and I'm sure my level of expertise will
be readily apparent.

Two problems occur. First when I copy to the 2nd workbook, the column width
is different (hence the "Autofit"). Secondly when I do my first group of
filters in book 2, it shows the correct rows, but hides all other rows down
to 65,450. I could live with that, but I want to do further sets of filters
and I run out of rows.

Any help gratefully received.

Steve W

Sub CopyTodays()

'This Sets Autofilter to select todays entries only from book 1, then copies
to book 2,then filters that data(3 different ways)and copies to another
sheet in book 2


Sheets("All").Select
Selection.AutoFilter field:=1, Criteria1:=Date
Cells.Select
Selection.Copy
Workbooks.Open "C:\Documents and Settings\Steve\My
Documents\Folder1\Folder2\Book2.xls"
Sheets("All").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.EntireColumn.AutoFit
Cells.Select
Selection.AutoFilter field:=6, Criteria1:="=40", Operator:=xlAnd
Selection.AutoFilter field:=9, Criteria1:="<14", Operator:=xlAnd
Selection.AutoFilter field:=15, Criteria1:="1"
Selection.Copy
Sheets("Test list").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Sheets("All").Select
-More Filters.......
End Sub


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
Copying Filtered Data in Excel 2007 Chgofan Excel Worksheet Functions 5 September 26th 07 07:06 PM
Copying filtered data to another worksheet DavidS Excel Worksheet Functions 4 April 7th 07 08:27 PM
Copying filtered data to another Excel Spreadsheet [email protected] Excel Discussion (Misc queries) 3 January 23rd 06 10:01 PM
Copying Filtered Data Shirley Munro Excel Discussion (Misc queries) 1 June 23rd 05 01:18 AM
Copying filtered data cghall55 Excel Programming 5 January 11th 05 04:14 PM


All times are GMT +1. The time now is 02:34 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"