View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Craigm[_30_] Craigm[_30_] is offline
external usenet poster
 
Posts: 1
Default Fustration Help? Filter, Visible Copy/Paste


I have struggled for a couple of weeks with AutoFilter and the coping
and pasting of VISIBLE cells only to a different worksheet.

I continually get a crash on the paste method. I suspect that the
crash is caused during the copy but is delayed until the paste. When I
step through the code the copy works but I notice two "marching ants"
areas. One area is the AutoFilter itself and the other area is the
visible data. The paste puts the visible data into the new worksheet
then crashes. The AutoFilter area is not pasted but still both areas
have the “marching ants”.

The data starts on row 8 with the following filter on row seven:
Selection.AutoFilter Field:=13, Criteria1:="12/31/2004",
Operator:=xlAnd _
, Criteria2:="<7/1/2005"

The filter's Critera1 seems to work even though the cells have data
like "1/9/2005 10:15:00 AM in them. Criteria2 seems to be ignored.

I have written loops, tried the visible cell types with no luck.
Select, resizing the range, paste. paste special...nothing is working
for me.

----Selection.SpecialCells(xlCellTypeVisible).Select
----Selection.SpecialCells(xlCellTypeVisible).Copy

The paste fails with "paste method of worksheet class failed".
"ActiveSheet.Paste" or Worksheets("Datadown").Range(srceRng).Copy
"Destination:=Worksheets("2005").Range(srceRng )" both have the same
result.

“With ActiveSheet.AutoFilter.Range” gives me an “Application defined or
object defined error.”

-----------------------------------------------------------
I have tried so many permutations that I cannot keep them straight.

Would some kind sole help me find sanity again with a code example that
I can learn from?

Respectfully, Craigm


--
Craigm
------------------------------------------------------------------------
Craigm's Profile: http://www.excelforum.com/member.php...o&userid=24381
View this thread: http://www.excelforum.com/showthread...hreadid=387968