Copy doesn't work

Status
Not open for further replies.

Demirion

Board Regular
Joined
Sep 21, 2022
Messages
66
Platform
  1. Windows
Hi, this code works:
VBA Code:
Worksheets("Ark1").Range(Cells(1, 1), Cells(lRow, lCol)).Copy Worksheets("Ark2").Range("A1")

but I want to copy data from the second row it doesn't work and error is displayed "Run-time error 1004. Application-definded or object-defined error":
VBA Code:
Worksheets("Ark1").Range(Cells(2, 1), Cells(lRow, lCol)).Copy Worksheets("Ark2").Range("A1")

What went wrong?
 
It will only work properly for the sheet that you are using to calculate those variables. But as I said for further help please start a new thread. And this time please explain EXACTLY what you are trying to do & what is wrong.
 
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Well, that's the thing, there are many sheets in this workbook, so how to make the variables work for all sheets or maybe it's easier to do it without variables? There are tables in the sheets that I want to copy without headers and paste into the second workbook to the second row.
 
Upvote 0
Please start a new thread as instructed. This thread is closed.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,215,973
Messages
6,128,040
Members
449,414
Latest member
sameri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top