LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default 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
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
Code Stops Running Instead of Debugging [email protected] Excel Discussion (Misc queries) 1 December 10th 08 07:15 PM
Instead of debugging, code just stops running [email protected] Excel Discussion (Misc queries) 1 August 13th 08 07:26 PM
can someone make code for tab/enter stops for me please? officegirl77 Excel Discussion (Misc queries) 0 November 21st 07 04:43 PM
(trying again...) code stops executing Mark Kubicki Excel Programming 0 December 4th 03 02:00 PM
VBA code stops executing Mark Kubicki Excel Programming 0 December 3rd 03 06:47 PM


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