Hello everyone,

I am Working with following kind of Data structure.

Category A

Product______Sales
P1__________12876
P2__________10987
P4__________876
P3__________567


Category B

Product_______Sales
P1___________78965
P2___________48965
P3___________25874
P4___________120



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 Labels 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.