PDA

View Full Version : Small problem : Filter/copy/past



jam03
09-17-2008, 07:35 AM
Hi guys,

I've had a little problem with this :

Selection.AutoFilter Field:=26, Criteria1:="Yes"
Selection.SpecialCells(xlCellTypeVisible).Copy
Sheets("TOP").Range("a1").PasteSpecial

indeed, when i filter the "Yes" and when i copy, it copies the whole page (the few 'Yes' rows + the 65 000 blank rows) resulting of a 5 megabyte file. Since i need to mail these excel files, it is quite troublesome for me...


Thanks in advance, Cheers,

Mateo

Bob Phillips
09-17-2008, 08:45 AM
That must be because you have selected the whole sheet, and even after filtering, the rows beyond the data are part of the selection visible rows.

Reduce your range to a meaningful set.

jam03
09-17-2008, 09:30 AM
Thx ! , i thought i could be automatic... but this way works just fine when defining a rather large scale.

Cheers