I need to copy data, but since the amount of data that needs copying is going to be pretty large, and filled in by hand, I would like to do that by using a macro.
I can't understand how Arrays work.
This gives me the right amount of copies, but only of the very last cell I need copied.
Sub copyer()
Dim fromH As Integer 'fromheight
Dim fromW As Integer 'fromwidth
Dim toH As Integer 'to height
Dim toW As Integer 'to width
Dim counter As Integer
counter = Worksheets("blad1").Range("D3").Value 'amount of filled-in data lines to copy
Dim Times As Integer 'number of times to run the loop, depending on the filled in data
Times = counter + 1
Dim tostart As Integer 'location where to start placing the data
'depending on how much data is already present
Dim toend As Integer 'location up to where to place
tostart = Sheets("blad2").Range("L1").Value + 1 '(+2 if theres a header)
toend = tostart + counter
Dim Copy As Integer
For Copy = 1 To Times
For toH = tostart To toend
For toW = 1 To 2
For fromH = 12 To 22 Step 2
For fromW = 1 To 26 Step 25
Sheets("blad2").Cells(toH, toW).Value = _
Sheets("blad1").Cells(fromH, fromW).Value
Next fromW
Next fromH
Next toW
Next toH
Next Copy
'this macro needs to copy the data
'from blad1
'from height 12 to 22 (steps of 2)(10 times)
'from width 1 and 26 (not the cells inbetween)
'to blad2
'to height depending on the data present (dim tostart)'till height needed (steps of 1)
'to width 1 and 2
'blad1, D3 holds the input-datacounter
'blad2, L1 holds the output-datacounter
End Sub