VBA Copy/Paste fixed range a number of times
Solved/Closed
srinivas_kala
Posts
4
Registration date
Thursday 19 September 2019
Status
Member
Last seen
10 October 2019
-
19 Sep 2019 à 12:31
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 15 Oct 2019 à 11:41
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 15 Oct 2019 à 11:41
Related:
- Excel vba paste values
- Excel vba find - Guide
- How to open vba in excel - Guide
- Why cant i copy and paste on instagram ✓ - Instagram Forum
- Excel vba vlookup - Excel Forum
- Excel mod apk for pc - Download - Spreadsheets
1 response
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Contributor
Last seen
27 December 2022
555
23 Sep 2019 à 12:07
23 Sep 2019 à 12:07
Hi Srinivas,
Give the following code a try:
Best regards,
Trowa
Give the following code a try:
Sub RunMe()
Dim x, dRow, Counter As Integer
Counter = InputBox("How many times would you like to paste?:")
dRow = 7
Range("A2:A6").Copy
For x = 1 To Counter
Range("A" & dRow).PasteSpecial
dRow = dRow + 5
Next x
Application.CutCopyMode = False
End Sub
Best regards,
Trowa
27 Sep 2019 à 11:51
Thanks for the Help. Works like a champ.
27 Sep 2019 à 13:01
I need to stop the code after 200 rows(40 times to copy A1:A5). Please help.
30 Sep 2019 à 11:48
For that a few minor changes are needed:
Sub RunMe() Dim x, dRow, Counter As Integer Counter = 39 dRow = 6 Range("A1:A5").Copy For x = 1 To Counter Range("A" & dRow).PasteSpecial dRow = dRow + 5 Next x Application.CutCopyMode = False End SubBest regards,
Trowa
10 Oct 2019 à 06:27
Sorry for the delayed response. I was on field visit. Thank you very much. this is what I really need. Once again thank you for your time and help.
15 Oct 2019 à 11:41