ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   vba copy code (https://www.excelbanter.com/excel-programming/323006-vba-copy-code.html)

Paul

vba copy code
 
this code is in sheet1; and the last line, before end sub,
produces an "application defined or object defined error".
can someone tell me why?

Sub x10()
Dim COUNTER1 As Integer
Dim COUNTER2 As Integer

COUNTER1 = [A1]
COUNTER2 = [B1]


Range(Cells(COUNTER1, 1), Cells(COUNTER1, 71)).Copy _
Worksheets("SHEET2").Range(Cells(COUNTER2, 1))

End Sub

Tom Ogilvy

vba copy code
 
Sub x10()
Dim COUNTER1 As Integer
Dim COUNTER2 As Integer

COUNTER1 = [A1]
COUNTER2 = [B1]


Range(Cells(COUNTER1, 1), Cells(COUNTER1, 71)).Copy _
Worksheets("SHEET2").Cells(COUNTER2, 1)

End Sub

--
Regards,
Tom Ogilvy

"Paul" wrote in message
...
this code is in sheet1; and the last line, before end sub,
produces an "application defined or object defined error".
can someone tell me why?

Sub x10()
Dim COUNTER1 As Integer
Dim COUNTER2 As Integer

COUNTER1 = [A1]
COUNTER2 = [B1]


Range(Cells(COUNTER1, 1), Cells(COUNTER1, 71)).Copy _
Worksheets("SHEET2").Range(Cells(COUNTER2, 1))

End Sub





All times are GMT +1. The time now is 08:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com