View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
sbell sbell is offline
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/