How to copy and paste based on quantity?
Closed
Jo
-
3 Dec 2011 à 11:05
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 3 Dec 2011 à 20:04
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 3 Dec 2011 à 20:04
Related:
- How to copy and paste based on quantity?
- How to copy paste youtube link on android - Guide
- Based on the values in cells b77 b81 ✓ - Excel Forum
- Based on the values in cells b77 ✓ - Excel Forum
- Pi copy paste - Guide
- Based on the cell values in cells b77 ✓ - Excel Forum
1 response
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
3 Dec 2011 à 20:04
3 Dec 2011 à 20:04
try this macro (note: row1 contain headers and data only from row no. 2)
Sub test()
Dim rc As Range, c As Range, dest As Range, j As Long
With Worksheets("sheet1")
Set rc = Range(.Range("c2"), .Range("C2").End(xlDown))
For Each c In rc
j = c.Value
c.EntireRow.Copy
With Worksheets("sheet2")
Set dest = .Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
Range(dest, dest.Offset(2, 0)).PasteSpecial
End With
Next c
End With
With Worksheets("sheet2")
Range(.Range("C2"), .Range("C2").End(xlDown)).FormulaArray = 1
End With
End Sub