erdem_ustun
New Member
- Joined
- Jun 19, 2018
- Messages
- 12
Hi,
I have excel files.
There are different sections in this file.
There are different features under each section.
Unequal weights are available for these features.
The sum of each section is 10.
However, if there are no features under a section, the weight of the non-features needs to be proportionally distributed to other features existing under the same section.
How can I do this with VBA.
First I set all the features and weights by default. Later, if the cell were written "No" in the column next to the no features, I thought it would be necessary to re-distribute the weight in this section.
But I could not .
As sample data
[TABLE="width: 500"]
<tbody>[TR]
[TD]Nbr[/TD]
[TD]Section 1[/TD]
[TD]Default weights[/TD]
[TD]Status[/TD]
[TD]Reweighted[/TD]
[/TR]
[TR]
[TD]1.1[/TD]
[TD]Feature 1[/TD]
[TD]3[/TD]
[TD][/TD]
[TD]3,75[/TD]
[/TR]
[TR]
[TD]1.2[/TD]
[TD]Feature 2[/TD]
[TD]5[/TD]
[TD][/TD]
[TD]6,25[/TD]
[/TR]
[TR]
[TD]1.3[/TD]
[TD]Feature 3[/TD]
[TD]2[/TD]
[TD]No[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Section 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2.1[/TD]
[TD]Feature 1[/TD]
[TD]5[/TD]
[TD][/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]2.2[/TD]
[TD]Feature 2[/TD]
[TD]5[/TD]
[TD][/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Section 3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3.1[/TD]
[TD]Feature 1[/TD]
[TD]2[/TD]
[TD]No[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3.2[/TD]
[TD]Feature 2[/TD]
[TD]2[/TD]
[TD][/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]3.3[/TD]
[TD]Feature 3[/TD]
[TD]2[/TD]
[TD]No[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3.4[/TD]
[TD]Feature 4[/TD]
[TD]4[/TD]
[TD]No[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]...
[/TD]
[TD].....[/TD]
[TD].....[/TD]
[TD]....[/TD]
[TD]....[/TD]
[/TR]
</tbody>[/TABLE]
I would like your help in this regard.
I have excel files.
There are different sections in this file.
There are different features under each section.
Unequal weights are available for these features.
The sum of each section is 10.
However, if there are no features under a section, the weight of the non-features needs to be proportionally distributed to other features existing under the same section.
How can I do this with VBA.
First I set all the features and weights by default. Later, if the cell were written "No" in the column next to the no features, I thought it would be necessary to re-distribute the weight in this section.
But I could not .
As sample data
[TABLE="width: 500"]
<tbody>[TR]
[TD]Nbr[/TD]
[TD]Section 1[/TD]
[TD]Default weights[/TD]
[TD]Status[/TD]
[TD]Reweighted[/TD]
[/TR]
[TR]
[TD]1.1[/TD]
[TD]Feature 1[/TD]
[TD]3[/TD]
[TD][/TD]
[TD]3,75[/TD]
[/TR]
[TR]
[TD]1.2[/TD]
[TD]Feature 2[/TD]
[TD]5[/TD]
[TD][/TD]
[TD]6,25[/TD]
[/TR]
[TR]
[TD]1.3[/TD]
[TD]Feature 3[/TD]
[TD]2[/TD]
[TD]No[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Section 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2.1[/TD]
[TD]Feature 1[/TD]
[TD]5[/TD]
[TD][/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]2.2[/TD]
[TD]Feature 2[/TD]
[TD]5[/TD]
[TD][/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Section 3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3.1[/TD]
[TD]Feature 1[/TD]
[TD]2[/TD]
[TD]No[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3.2[/TD]
[TD]Feature 2[/TD]
[TD]2[/TD]
[TD][/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]3.3[/TD]
[TD]Feature 3[/TD]
[TD]2[/TD]
[TD]No[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3.4[/TD]
[TD]Feature 4[/TD]
[TD]4[/TD]
[TD]No[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]...
[/TD]
[TD].....[/TD]
[TD].....[/TD]
[TD]....[/TD]
[TD]....[/TD]
[/TR]
</tbody>[/TABLE]
I would like your help in this regard.