Vb, how to copy values & repeat to next 50 cells
Closed
weenie
Posts
9
Registration date
Saturday July 3, 2010
Status
Member
Last seen
May 5, 2016
-
Jan 16, 2014 at 11:59 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jan 20, 2014 at 10:56 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jan 20, 2014 at 10:56 AM
Related:
- Vb, how to copy values & repeat to next 50 cells
- Gta 5 download apk 50 mb - Download - Action and adventure
- 50 languages book 2 pdf - Download - Education
- How to automatically copy cells from one sheet to another - Guide
- Excel macro to create new sheet based on value in cells - Guide
- Excel arrow keys not moving cells - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
552
Jan 20, 2014 at 10:56 AM
Jan 20, 2014 at 10:56 AM
Hi Weenie,
The following code will loop through all used columns starting at E.
4 Rows of the respective column will be copied and transposed to the first available row in column A.
The 4 rows from the respective column will be cleared.
The transposed data will be repeated 49 times (covering row 2-51 for first batch).
Best regards,
Trowa
The following code will loop through all used columns starting at E.
4 Rows of the respective column will be copied and transposed to the first available row in column A.
The 4 rows from the respective column will be cleared.
The transposed data will be repeated 49 times (covering row 2-51 for first batch).
Sub RunMe()
Dim lCol, x, y As Integer
lCol = Range("E1").End(xlToRight).Column
x = 2
y = 51
For Each cell In Range(Cells(1, "E"), Cells(1, lCol))
Range(cell, cell.Offset(3, 0)).Copy
Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial Transpose:=True
Range(cell, cell.Offset(3, 0)).ClearContents
Range(Cells(x, "A"), Cells(x, "D")).Copy
Do
Range("A" & x + 1).PasteSpecial
x = x + 1
Loop Until x = y
y = y + 50
x = x + 1
Next cell
Application.CutCopyMode = False
End Sub
Best regards,
Trowa