hi all,
i'm just a beginner with vba so please give me an explanation for the answer below. As a note, i'm looking to solve this with vba as this is part of a longer piece of code. I'm working with a table like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Absolute Return[/TD]
[TD]Description[/TD]
[TD]Percentage[/TD]
[/TR]
[TR]
[TD]Strategy A[/TD]
[TD]Strategy A invests in X Y and Z[/TD]
[TD]1.5%[/TD]
[/TR]
[TR]
[TD]Strategy B[/TD]
[TD]Strategy B shorts A B and C [/TD]
[TD]2.5[/TD]
[/TR]
[TR]
[TD]Absolute Return[/TD]
[TD][/TD]
[TD]4.0%[/TD]
[/TR]
[TR]
[TD]Strategy C[/TD]
[TD]Strategy C invests in ... [/TD]
[TD]1.2%[/TD]
[/TR]
</tbody>[/TABLE]
for the lines in bold, the strategy sub total, I'd like to add a row below that will work as the strategy title for the range below. For example, if Strategy C was Convertible arbitrage, the inserted row will say convertible abitrage. Example of final table:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Absolute Return[/TD]
[TD]Description[/TD]
[TD]Percentage[/TD]
[/TR]
[TR]
[TD]Strategy A[/TD]
[TD]Strategy A invests in X Y and Z[/TD]
[TD]1.5%[/TD]
[/TR]
[TR]
[TD]Strategy B[/TD]
[TD]Strategy B shorts A B and C [/TD]
[TD]2.5[/TD]
[/TR]
[TR]
[TD]Absolute Return[/TD]
[TD][/TD]
[TD]4.0%[/TD]
[/TR]
[TR]
[TD]Convertible Arbitrage
[/TD]
[TD][/TD]
[TD]Percentage[/TD]
[/TR]
[TR]
[TD]Strategy C[/TD]
[TD]Strategy C invests in ... [/TD]
[TD]1.2%
[/TD]
[/TR]
</tbody>[/TABLE]
I'm trying to work on the condition that if a cell in the description column is blank and the cell in the 1st column is filled, insert a new row, fill in the strategy name and loop.
Thanks.
i'm just a beginner with vba so please give me an explanation for the answer below. As a note, i'm looking to solve this with vba as this is part of a longer piece of code. I'm working with a table like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Absolute Return[/TD]
[TD]Description[/TD]
[TD]Percentage[/TD]
[/TR]
[TR]
[TD]Strategy A[/TD]
[TD]Strategy A invests in X Y and Z[/TD]
[TD]1.5%[/TD]
[/TR]
[TR]
[TD]Strategy B[/TD]
[TD]Strategy B shorts A B and C [/TD]
[TD]2.5[/TD]
[/TR]
[TR]
[TD]Absolute Return[/TD]
[TD][/TD]
[TD]4.0%[/TD]
[/TR]
[TR]
[TD]Strategy C[/TD]
[TD]Strategy C invests in ... [/TD]
[TD]1.2%[/TD]
[/TR]
</tbody>[/TABLE]
for the lines in bold, the strategy sub total, I'd like to add a row below that will work as the strategy title for the range below. For example, if Strategy C was Convertible arbitrage, the inserted row will say convertible abitrage. Example of final table:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Absolute Return[/TD]
[TD]Description[/TD]
[TD]Percentage[/TD]
[/TR]
[TR]
[TD]Strategy A[/TD]
[TD]Strategy A invests in X Y and Z[/TD]
[TD]1.5%[/TD]
[/TR]
[TR]
[TD]Strategy B[/TD]
[TD]Strategy B shorts A B and C [/TD]
[TD]2.5[/TD]
[/TR]
[TR]
[TD]Absolute Return[/TD]
[TD][/TD]
[TD]4.0%[/TD]
[/TR]
[TR]
[TD]Convertible Arbitrage
[/TD]
[TD][/TD]
[TD]Percentage[/TD]
[/TR]
[TR]
[TD]Strategy C[/TD]
[TD]Strategy C invests in ... [/TD]
[TD]1.2%
[/TD]
[/TR]
</tbody>[/TABLE]
I'm trying to work on the condition that if a cell in the description column is blank and the cell in the 1st column is filled, insert a new row, fill in the strategy name and loop.
Thanks.