jwalkerack
Board Regular
- Joined
- Jun 19, 2013
- Messages
- 81
Hello everyone , i m not sure if i m saying this right but here goes . i have data set of two values . For example time versus distance. For each time value there is a corresponding distance. i would like to be able have a macro that inserts a row between every time and distance point i have . Next i would like to have a macro that automatically calcuates and populates the difference between the rows.
So my original data set would be as follows
[TABLE="width: 139"]
<tbody>[TR]
[TD]time [/TD]
[TD]Distance[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="align: right"]67[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]89[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]100[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: right"]140[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]189[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD="align: right"]220[/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[/TR]
</tbody>[/TABLE]
This is it with inserted rows one after each column that has data
[TABLE="width: 139"]
<tbody>[TR]
[TD]time[/TD]
[TD]Distance[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]67[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]89[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]100[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]140[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]189[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]220[/TD]
[TD="align: right"]10[/TD]
[/TR]
</tbody>[/TABLE]
i know the calculation to work out the difference between the 2 value. Is the bottom value subtracted by the top value and then halved and added to the bottom value . IE 2-1= 1/2= 0.5 +1= 1.5 so 1.5 would be the second row entry for distance field . Is it possible to have a two macros that will constantly allow me to double my data set ?
i want to have something like this in the end and be able to repeat the several times , each time increasing my dataset
[TABLE="width: 139"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]time [/TD]
[TD]Distance [/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]7.5[/TD]
[TD="align: right"]1.5[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD="align: right"]2.5[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]20[/TD]
[TD="align: right"]3.5[/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="align: right"]46[/TD]
[TD="align: right"]4.5[/TD]
[/TR]
[TR]
[TD="align: right"]67[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]78[/TD]
[TD="align: right"]5.5[/TD]
[/TR]
[TR]
[TD="align: right"]89[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]94.5[/TD]
[TD="align: right"]6.5[/TD]
[/TR]
[TR]
[TD="align: right"]100[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: right"]120[/TD]
[TD="align: right"]7.5[/TD]
[/TR]
[TR]
[TD="align: right"]140[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]164.5[/TD]
[TD="align: right"]8.5[/TD]
[/TR]
[TR]
[TD="align: right"]189[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD="align: right"]204.5[/TD]
[TD="align: right"]9.5[/TD]
[/TR]
[TR]
[TD="align: right"]220[/TD]
[TD="align: right"]10[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 139"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]7.5[/TD]
[TD="align: right"]1.5[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD="align: right"]2.5[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]20[/TD]
[TD="align: right"]3.5[/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="align: right"]46[/TD]
[TD="align: right"]4.5[/TD]
[/TR]
[TR]
[TD="align: right"]67[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]78[/TD]
[TD="align: right"]5.5[/TD]
[/TR]
[TR]
[TD="align: right"]89[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]94.5[/TD]
[TD="align: right"]6.5[/TD]
[/TR]
[TR]
[TD="align: right"]100[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: right"]120[/TD]
[TD="align: right"]7.5[/TD]
[/TR]
[TR]
[TD="align: right"]140[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]164.5[/TD]
[TD="align: right"]8.5[/TD]
[/TR]
[TR]
[TD="align: right"]189[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD="align: right"]204.5[/TD]
[TD="align: right"]9.5[/TD]
[/TR]
[TR]
[TD="align: right"]220[/TD]
[TD="align: right"]10[/TD]
[/TR]
</tbody>[/TABLE]
So my original data set would be as follows
[TABLE="width: 139"]
<tbody>[TR]
[TD]time [/TD]
[TD]Distance[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="align: right"]67[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]89[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]100[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: right"]140[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]189[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD="align: right"]220[/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[/TR]
</tbody>[/TABLE]
This is it with inserted rows one after each column that has data
[TABLE="width: 139"]
<tbody>[TR]
[TD]time[/TD]
[TD]Distance[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]67[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]89[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]100[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]140[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]189[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]220[/TD]
[TD="align: right"]10[/TD]
[/TR]
</tbody>[/TABLE]
i know the calculation to work out the difference between the 2 value. Is the bottom value subtracted by the top value and then halved and added to the bottom value . IE 2-1= 1/2= 0.5 +1= 1.5 so 1.5 would be the second row entry for distance field . Is it possible to have a two macros that will constantly allow me to double my data set ?
i want to have something like this in the end and be able to repeat the several times , each time increasing my dataset
[TABLE="width: 139"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]time [/TD]
[TD]Distance [/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]7.5[/TD]
[TD="align: right"]1.5[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD="align: right"]2.5[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]20[/TD]
[TD="align: right"]3.5[/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="align: right"]46[/TD]
[TD="align: right"]4.5[/TD]
[/TR]
[TR]
[TD="align: right"]67[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]78[/TD]
[TD="align: right"]5.5[/TD]
[/TR]
[TR]
[TD="align: right"]89[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]94.5[/TD]
[TD="align: right"]6.5[/TD]
[/TR]
[TR]
[TD="align: right"]100[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: right"]120[/TD]
[TD="align: right"]7.5[/TD]
[/TR]
[TR]
[TD="align: right"]140[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]164.5[/TD]
[TD="align: right"]8.5[/TD]
[/TR]
[TR]
[TD="align: right"]189[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD="align: right"]204.5[/TD]
[TD="align: right"]9.5[/TD]
[/TR]
[TR]
[TD="align: right"]220[/TD]
[TD="align: right"]10[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 139"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]7.5[/TD]
[TD="align: right"]1.5[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD="align: right"]2.5[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]20[/TD]
[TD="align: right"]3.5[/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="align: right"]46[/TD]
[TD="align: right"]4.5[/TD]
[/TR]
[TR]
[TD="align: right"]67[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]78[/TD]
[TD="align: right"]5.5[/TD]
[/TR]
[TR]
[TD="align: right"]89[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]94.5[/TD]
[TD="align: right"]6.5[/TD]
[/TR]
[TR]
[TD="align: right"]100[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: right"]120[/TD]
[TD="align: right"]7.5[/TD]
[/TR]
[TR]
[TD="align: right"]140[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]164.5[/TD]
[TD="align: right"]8.5[/TD]
[/TR]
[TR]
[TD="align: right"]189[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD="align: right"]204.5[/TD]
[TD="align: right"]9.5[/TD]
[/TR]
[TR]
[TD="align: right"]220[/TD]
[TD="align: right"]10[/TD]
[/TR]
</tbody>[/TABLE]
Last edited: