Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Range Select Error

I’m having trouble selecting a range of cells on one sheet and copyin
them to another. I’ve tried using the tried and true method o
recording a macro and pasting the code to a command button where I wan
it… and even this idea has failed me.

Windows("AQWA002.CSV").Activate
Range("B7:B9840").Select
Selection.Copy
Windows("0510.xls").Activate
Range("C31").Select
ActiveSheet.Paste

I keep getting a ‘Select method of Range class failed’ error at th
second line.

Can somebody explain why this doesn’t work and what I need to do to fi
it?

Thanks

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Range Select Error

Not sure why you are having trouble.

But try the below code. Be sure to fill in the sheet names (or index
number).
Note that no selection is required. And watch out for the line continuation
after ".Copy _"
'''''''''''''''''''''''''''''''''''
Workbooks("AQWA002.CSV").Sheets(?).Range("B7:B9840 ").Copy _
Destination:=Workbooks("0510.xls").Sheets(??).Rang e("C31")
'''''''''''''''''''''''''''''''''''
hth
--
steveb
(Remove 'NoSpam' from email address if replying direct)
"sailingdan " wrote in message
...
I'm having trouble selecting a range of cells on one sheet and copying
them to another. I've tried using the tried and true method of
recording a macro and pasting the code to a command button where I want
it. and even this idea has failed me.

Windows("AQWA002.CSV").Activate
Range("B7:B9840").Select
Selection.Copy
Windows("0510.xls").Activate
Range("C31").Select
ActiveSheet.Paste

I keep getting a 'Select method of Range class failed' error at the
second line.

Can somebody explain why this doesn't work and what I need to do to fix
it?

Thanks.


---
Message posted from http://www.ExcelForum.com/



Reply
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
Run-Time error '1004' : Select method of Range class failed [email protected] Excel Discussion (Misc queries) 3 March 9th 07 01:36 PM
Error 1004, "select method of range class failed" paritoshmehta[_11_] Excel Programming 3 May 6th 04 10:09 PM
excel97: runtime error 1004 select method of range class failed JMCN Excel Programming 4 December 25th 03 05:32 AM
Run-time 1004 error on range select Morgan[_3_] Excel Programming 3 November 11th 03 11:44 PM
error 1004 Select method of Range class failed J.E. McGimpsey Excel Programming 1 September 12th 03 07:42 PM


All times are GMT +1. The time now is 05:21 PM.

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"