Hello, I found this code here. It was posted by someone
@DanteAmor works fine for me, but it requires some modifications to match the original file.
I am copying data from Sheet 1 to Sheet 2 with a certain number of rows, which is 10, leaving 4 rows empty. What I want to do now is copy the titles for every 10 rows copied. Indeed, is there a way that I can use it without writing the names of the paste cell, because it is actually fixed and does not change. The first cell is A1. Every 14 rows, the titles are copied. But when I make sure the cell in the 15th row has a value. A column
With the word TOTAL inserted under every 10 rows, i.e. row 11 of each column range ( j )If it is possible thank you
@DanteAmor works fine for me, but it requires some modifications to match the original file.
I am copying data from Sheet 1 to Sheet 2 with a certain number of rows, which is 10, leaving 4 rows empty. What I want to do now is copy the titles for every 10 rows copied. Indeed, is there a way that I can use it without writing the names of the paste cell, because it is actually fixed and does not change. The first cell is A1. Every 14 rows, the titles are copied. But when I make sure the cell in the 15th row has a value. A column
With the word TOTAL inserted under every 10 rows, i.e. row 11 of each column range ( j )If it is possible thank you
VBA Code:
Sub Copy_Values()
Dim i As Long
Dim sh As Worksheet
Set sh = Sheet1
Dim dest As Worksheet
Set dest = Sheet2
Application.ScreenUpdating = False
Dim ary As Variant
ary = Array("A1", "a15", "a29", "a43", "a57", "a71") '...............................................unknown ***Always + 14 Rows******
For i = 0 To UBound(ary)
sh.Range("A1:P3").Copy
dest.Range(ary(i)).PasteSpecial xlPasteValues
dest.Range(ary(i)).PasteSpecial Paste:=xlPasteFormats
Next
End Sub