View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Jurassien Jurassien is offline
external usenet poster
 
Posts: 24
Default Copying and Pasting Macro

Thanks a bunch! I got it now.

"Gord Dibben" wrote:

I would suggest one of your sheetnames is incorrect.

If I change "Data" to "Yata" I get a "subscript out of range" error 9


Gord

On Wed, 7 Feb 2007 15:26:00 -0800, Jurassien
wrote:

Yes indeed I am getting an error message #9. I,ll go ahead try it again.

Thanks,

"Gord Dibben" wrote:

"not seem to be working" is a bit vague.

What doesn't happen or does happen when you run your macro?

Do you get errors or?

Works for me after I clean up the line wrapping.

Sub DoCopy()
Dim szRange As String
szRange = "E2:V200"
Worksheets("Data").Range _
(szRange).Copy Destination:=Worksheets _
("sheet2").Range(szRange)
End Sub



Gord Dibben MS Excel MVP

On Wed, 7 Feb 2007 11:57:00 -0800, Jurassien
wrote:


Hello,

I need helps on creating a macro that will copy and paste specific range
(E2:V200) from Sheet1 to Sheet 2 and so on. The script that I have does not
seem to working. Please Help!

Sub DoCopy()
Dim szRange As String
szRange = "E2:V200"
Worksheets("Data").Range
(szRange).Copy Destination:=Worksheets
("sheet2").Range(szRange)
End Sub

Thanks,