How to copy the data from one sheet to another sheet

hongwei

New Member
Joined
Oct 20, 2021
Messages
8
Office Version
  1. 365
Platform
  1. Windows
I want to copy data from another worksheet.
Example:
copy N3,N4,N5 of sheet2 to L3,L4,L5 of sheet 1
next step will be,
copy O3,O4,O5 of sheet2 to L6,L7,L8 of sheet 1
the same pattern continue...
another says i want to copy every 3 lines of one column in sheet2 and move to another column and copy another 3 lines and go on. The destination will be at one column in sheet1.
i have hundreds lines of data to be copied, i dont want to do it manually. Anyone has any ideas ?
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

offthelip

Well-known Member
Joined
Dec 23, 2017
Messages
2,479
Office Version
  1. 2010
Platform
  1. Windows
try this:
VBA Code:
Sub test2()
With Worksheets("Sheet2")
lastcol = .Cells(5, .Columns.Count).End(xlToLeft).Column
inarr = .Range(.Cells(1, 1), .Cells(7, lastcol))
End With
With Worksheets("Sheet1")
 outarr = .Range(.Cells(1, 12), .Cells(lastcol * 3, 12))
ix = 3
For i = 14 To lastcol
  For j = 5 To 7
   outarr(ix, 1) = inarr(j, i)
   ix = ix + 1
  Next j
Next i
.Range(.Cells(1, 12), .Cells(lastcol * 3, 12)) = outarr

 
End With
End Sub
 
Solution
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,477
Messages
5,831,890
Members
430,090
Latest member
bjonesh2o

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
Top