Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Destination:= Code Stops Here
Hi
The code below works perfectly on my laptop running WinXP & Excel 2002 but fails on my PC running WinXP and Excel 2003. I copied the spreadsheet by first burning to a CD then opening file in Excel 2003 and finally copying to my PC's hard drive. Was that a correct or ok procedure?. When run the code stops on each of the 3 lines containing "Copy Destination:=Worksheet...etc. The error message reads "Run-time error '1004' Copy method of Range class failed". Opening the worksheet "A-TSI - 04" the data for the first line has been copied across. By moving the yellow line to the 2nd line and stepping through also copys across ok, same with the 3rd line. Moving the yellow highlight to next line of code, will allow auto running of code to the "End Sub" line and every thing in "A-TSI - 04" looks good. Code from Tom Ogilvy: Selection.AutoFilter Field:=23, Criteria1:="Y" Set rng = Sheets("Names").AutoFilter.Range Set rng = rng.Offset(1, 0).Resize(rng.Rows.Count - 1, 1) rng.Copy Destination:=Worksheets("A-TSI - 04").Range("A2") Range("D2:D" & Range("A500").End(xlUp).Row).Copy Destination:= _ Worksheets("A-TSI - 04").Range("B2") Range("Q2:Q" & Range("A500").End(xlUp).Row).Copy Destination:= _ Worksheets("A-TSI - 04").Range("X2") I've tried lowering my security level, and all else in Help. Can anyone shed some light on this problem?. -- Thank you Regards Bob C |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code Stops Running Instead of Debugging | Excel Discussion (Misc queries) | |||
Instead of debugging, code just stops running | Excel Discussion (Misc queries) | |||
can someone make code for tab/enter stops for me please? | Excel Discussion (Misc queries) | |||
(trying again...) code stops executing | Excel Programming | |||
VBA code stops executing | Excel Programming |