Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Copying and Pasting Macro


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,
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Copying and Pasting Macro

"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,


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Copying and Pasting Macro

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,



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Copying and Pasting Macro

I have cleaned up the line wrap. I can compile the code, but when I run the
macro I get this message "Subscript out of range" What do I need to do in
order to get macro working properly (generating result)?

"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,



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Copying and Pasting Macro

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,






  #6   Report Post  
Posted to microsoft.public.excel.misc
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,




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Copying and Pasting Macro

Excellent

Those darn sheetnames with a space where it doesn't get noticed<g

Gord


On Wed, 7 Feb 2007 15:54:05 -0800, Jurassien
wrote:

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,





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
Copying and Pasting Rows Macro tnederlof Excel Discussion (Misc queries) 1 February 2nd 07 05:23 PM
Copying and pasting with macros mCassidy Excel Discussion (Misc queries) 2 January 3rd 07 02:06 PM
Copying Data from Access to Excel in a macro GLS Excel Worksheet Functions 2 November 15th 06 03:47 PM
Pasting a value not a formula in a macro Alec H Excel Discussion (Misc queries) 1 February 23rd 06 10:58 AM
Copying and Pasting between Workbooks NothingButRomance Excel Worksheet Functions 0 May 13th 05 07:33 PM


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