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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
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
 
Upvote 0
Solution

Forum statistics

Threads
1,214,996
Messages
6,122,636
Members
449,092
Latest member
bsb1122

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