Fiveshorter
New Member
- Joined
- Jul 14, 2017
- Messages
- 18
Hi,
I have two columns of data :
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]33[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]12
[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]44[/TD]
[/TR]
</tbody>[/TABLE]
What I would like to be able to do is ask the user how many in column 1, cells are the same (what is the trend) in this case it would be two as we have Two As, Two Bs. Then I would like to be able to prompt the user for two inputs ( as we entered two before this as this is the trend ), input the letter 'D' and the number "33.33". So the data will now look like this :
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]23[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]33[/TD]
[TD]33.33[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]12[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]44[/TD]
[TD]33.33[/TD]
[/TR]
</tbody>[/TABLE]
Another example if I had the following table :
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]34[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]13[/TD]
[/TR]
</tbody>[/TABLE]
The trend is 3 as we have 3 a's and 3 b's. Then we enter 3 pieces of information, input 1 =2.22, input 2 = 444.55, input 3 = 33.99999 and our table would look like this :
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]22[/TD]
[TD]2.22[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]34[/TD]
[TD]444.55[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]4[/TD]
[TD]33.99999[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]23[/TD]
[TD]2.22[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]2[/TD]
[TD]444.55[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]13[/TD]
[TD]33.99999[/TD]
[/TR]
</tbody>[/TABLE]
If anyone could help to build a macro for this it would be greatly appreciated, hopefully I explained well enough!
Thanks!
I have two columns of data :
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]33[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]12
[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]44[/TD]
[/TR]
</tbody>[/TABLE]
What I would like to be able to do is ask the user how many in column 1, cells are the same (what is the trend) in this case it would be two as we have Two As, Two Bs. Then I would like to be able to prompt the user for two inputs ( as we entered two before this as this is the trend ), input the letter 'D' and the number "33.33". So the data will now look like this :
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]23[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]33[/TD]
[TD]33.33[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]12[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]44[/TD]
[TD]33.33[/TD]
[/TR]
</tbody>[/TABLE]
Another example if I had the following table :
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]34[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]13[/TD]
[/TR]
</tbody>[/TABLE]
The trend is 3 as we have 3 a's and 3 b's. Then we enter 3 pieces of information, input 1 =2.22, input 2 = 444.55, input 3 = 33.99999 and our table would look like this :
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]22[/TD]
[TD]2.22[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]34[/TD]
[TD]444.55[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]4[/TD]
[TD]33.99999[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]23[/TD]
[TD]2.22[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]2[/TD]
[TD]444.55[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]13[/TD]
[TD]33.99999[/TD]
[/TR]
</tbody>[/TABLE]
If anyone could help to build a macro for this it would be greatly appreciated, hopefully I explained well enough!
Thanks!