Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I assume neither the source or destination contain merged cells and neither
is protected. You might try Dim obj as Window set obj = ActiveWindow ActiveWindow.Visible = False Windows("060631 Charts_DataDown.xls").Activate Sheets("Datadown").Select Rows("7:7").Select Range("J7").Activate Selection.AutoFilter ActiveWindow.LargeScroll ToRight:=1 Selection.AutoFilter Field:=13, Criteria1:="12/31/2004", Operator:=xlAnd _ , Criteria2:="<1/1/2006" Cells.Select Selection.Copy obj.visible = True obj.Activate Sheets("2005").Select Worksheets("2005").Activate Range("A1").Select ActiveSheet.Paste -- Regards, Tom Ogilvy "Craigm" wrote in message ... The code below runs sometimes then it crashes other times with a "Paste Method of Worksheet Class Failed". The Debugger stops on the "ActiveSheet.Paste" line. It always copies and pastes the correct filtered data. It may have something to do with the filter being on or off before the routine is run??? Thats a guess. I've tried to fix this so may ways I can't think anymore. Any ideas? Thanks! ---------------------------------------- ActiveWindow.Visible = False Windows("060631 Charts_DataDown.xls").Activate Sheets("Datadown").Select Rows("7:7").Select Range("J7").Activate Selection.AutoFilter ActiveWindow.LargeScroll ToRight:=1 Selection.AutoFilter Field:=13, Criteria1:="12/31/2004", Operator:=xlAnd _ , Criteria2:="<1/1/2006" Cells.Select Selection.Copy Sheets("2005").Select Worksheets("2005").Activate ActiveSheet.Paste Destination:=Worksheets("2005").Range("A1") -------------------------------------- -- Craigm ------------------------------------------------------------------------ Craigm's Profile: http://www.excelforum.com/member.php...o&userid=24381 View this thread: http://www.excelforum.com/showthread...hreadid=385573 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
paste from excel to works database all it shows is "picture" | Excel Discussion (Misc queries) | |||
Cell Paste using cell link option Half works | Excel Worksheet Functions | |||
HELP! Copy/Paste Macro Works on PC But Not Mac! | Excel Discussion (Misc queries) | |||
I cannot paste from one workbook to another. Copy works, paste do. | Excel Discussion (Misc queries) |