Hi,
I have values:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Values (col a)[/TD]
[TD]Percent (col b)[/TD]
[TD]Result (col c)[/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD]2[/TD]
[TD]20.4[/TD]
[/TR]
[TR]
[TD]30[/TD]
[TD]5[/TD]
[TD]31.5[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]40[/TD]
[TD]10.4[/TD]
[/TR]
</tbody>[/TABLE]
equation should looks:
result = 20 * 1.02 = 20.4
result = 30 * 1.05 = 31,5
result = 10 * 1.4 = 14
How can I do it into Vba? Because I doing now as below: (result is the same)
I have values:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Values (col a)[/TD]
[TD]Percent (col b)[/TD]
[TD]Result (col c)[/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD]2[/TD]
[TD]20.4[/TD]
[/TR]
[TR]
[TD]30[/TD]
[TD]5[/TD]
[TD]31.5[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]40[/TD]
[TD]10.4[/TD]
[/TR]
</tbody>[/TABLE]
equation should looks:
result = 20 * 1.02 = 20.4
result = 30 * 1.05 = 31,5
result = 10 * 1.4 = 14
How can I do it into Vba? Because I doing now as below: (result is the same)
Code:
ws.Range("C2").Value = (ws.Range("A2").Value * ws.Range("B2").Value / 100 ) + ws.Range("A2").Value
ws.Range("C3").Value = (ws.Range("A3").Value * ws.Range("B3").Value / 100 ) + ws.Range("A3").Value
ws.Range("C4").Value = (ws.Range("A4").Value * ws.Range("B4").Value / 100 ) + ws.Range("A4").Value