ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   copy 45 rows down, repetativly, only on button click? (https://www.excelbanter.com/excel-worksheet-functions/27841-re-copy-45-rows-down-repetativly-only-button-click.html)

swatsp0p

copy 45 rows down, repetativly, only on button click?
 

Try...
------------------------------------
Private Sub CommandButton1_Click()

Row = 7 ' adjust starting point as needed
Range("A" & Row).EntireRow.Copy
For i = 0 To 1000 Step 45
'adjust to meet your needs
If Range("A" & Row + i) = "" Then Range("A" & Row + i).PasteSpecial
Next i

End Sub

------------------------------------

Does this work for you?


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=373342


swatsp0p


Try...
------------------------------------
Private Sub CommandButton1_Click()

Row = 7
' adjust starting point as needed
Range("A" & Row).EntireRow.Copy
For i = 0 To 1000 Step 45
' adjust to meet your needs
If Range("A" & Row + i) = "" Then Range("A" & Row + i).PasteSpecial
Next i

End Sub


If a row has data in A, it will not paste, then skip another 45 rows
and repeat....

Does this work for you?


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=373342



All times are GMT +1. The time now is 07:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com