Im struggeling with a macro which needs to convert 15 min intervals to 30 min
Original data looks like
[TABLE="width: 256"]
<tbody>[TR]
[TD="class: xl63, width: 64, align: right"]00:00[/TD]
[TD="width: 64, align: right"]2[/TD]
[TD="width: 64, align: right"]3[/TD]
[TD="width: 64, align: right"]5[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]00:15[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]00:30[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]00:45[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]01:00[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]01:15[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[/TR]
</tbody>[/TABLE]
and I would need such an outcome somewhere right or left from the original
[TABLE="width: 256"]
<tbody>[TR]
[TD="class: xl65, width: 64, align: right"]00:00[/TD]
[TD="width: 64, align: right"]4[/TD]
[TD="width: 64, align: right"]4[/TD]
[TD="width: 64, align: right"]9[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]00:30[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]01:00[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]5[/TD]
[/TR]
</tbody>[/TABLE]
This is how far I have come
Sub IEX2()
Dim m As Integer
Dim i As Integer
For m = 1 To 10
Cells(m, 2).Value = WorksheetFunction.Sum(Cells(m * 2 - 1, 1).Resize(2))
Next
End Sub
It works even but I need to loop it somehow so it converts all coming columns and not just one. Could someone help?
Original data looks like
[TABLE="width: 256"]
<tbody>[TR]
[TD="class: xl63, width: 64, align: right"]00:00[/TD]
[TD="width: 64, align: right"]2[/TD]
[TD="width: 64, align: right"]3[/TD]
[TD="width: 64, align: right"]5[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]00:15[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]00:30[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]00:45[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]01:00[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]01:15[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[/TR]
</tbody>[/TABLE]
and I would need such an outcome somewhere right or left from the original
[TABLE="width: 256"]
<tbody>[TR]
[TD="class: xl65, width: 64, align: right"]00:00[/TD]
[TD="width: 64, align: right"]4[/TD]
[TD="width: 64, align: right"]4[/TD]
[TD="width: 64, align: right"]9[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]00:30[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]01:00[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]5[/TD]
[/TR]
</tbody>[/TABLE]
This is how far I have come
Sub IEX2()
Dim m As Integer
Dim i As Integer
For m = 1 To 10
Cells(m, 2).Value = WorksheetFunction.Sum(Cells(m * 2 - 1, 1).Resize(2))
Next
End Sub
It works even but I need to loop it somehow so it converts all coming columns and not just one. Could someone help?
Last edited: