Hi All,
I am Working with following kind of Data structure.
Category A
<tbody>
</tbody>
Category B
<tbody>
</tbody>
I have one Form Combo Box containing list 'Category A, Category B' and I linked this Combo Box to above two data rages using Indirect Function.
for example my Output range is C8:D11 (which is Pie Chart range) and if I select Category A then Category A data will be displayed and if I select Category B then Category B data will be displayed in C8:D11 and so chart will change dynamically.
I want Data Labels in % and Decimal Places 0 if value>1 and 0.0 format if Value<1, 0.00 if value<0.1 etc .
For Category A Data lablels are 51%, 43%, 3%, 2% .
For Category B, Data Labels are 51%, 32%, 17%, 0% (=0.07 which I want to be dispalyed as 0.1 %).
Problem is that I cannot find a way to have dynamic number format for 4th product when A and B Categories are selected.
Is it possible to wright VBA code which checks each data label with conditions like Decimal Places 0 if value>1 and 0.0 format if Value<1, 0.00 if value<0.1 and gives required number format?
Thanks.
I am Working with following kind of Data structure.
Category A
Product | Sales |
P1 | 12876 |
P2 | 10987 |
P4 | 876 |
P3 | 567 |
<tbody>
</tbody>
Category B
Product | Sales |
P1 | 78965 |
P2 | 48965 |
P3 | 25874 |
P4 | 120 |
<tbody>
</tbody>
I have one Form Combo Box containing list 'Category A, Category B' and I linked this Combo Box to above two data rages using Indirect Function.
for example my Output range is C8:D11 (which is Pie Chart range) and if I select Category A then Category A data will be displayed and if I select Category B then Category B data will be displayed in C8:D11 and so chart will change dynamically.
I want Data Labels in % and Decimal Places 0 if value>1 and 0.0 format if Value<1, 0.00 if value<0.1 etc .
For Category A Data lablels are 51%, 43%, 3%, 2% .
For Category B, Data Labels are 51%, 32%, 17%, 0% (=0.07 which I want to be dispalyed as 0.1 %).
Problem is that I cannot find a way to have dynamic number format for 4th product when A and B Categories are selected.
Is it possible to wright VBA code which checks each data label with conditions like Decimal Places 0 if value>1 and 0.0 format if Value<1, 0.00 if value<0.1 and gives required number format?
Thanks.
Last edited: