Not show zero values in chart

Duncgee

Board Regular
Joined
Oct 7, 2002
Messages
73
I want Excel not to show zero values in data labels on a pie chart.

I also want the corresponding name not to show on the Legend.

Advice please, anyone?
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

PaddyD

MrExcel MVP
Joined
May 1, 2002
Messages
14,234
add a filter to the source data, customn filter out values that = zero - excel's default is to plot visable cells only.

Paddy
 

Duncgee

Board Regular
Joined
Oct 7, 2002
Messages
73
PaddyD thanks for your help. I am most greatfull.

That almost works perfect, but when I add a filter as you suggest, the row stays hidden even when the data changes and cell no longer has a zero value. Can the filter be made to reflect changes in the data.

Since my original post I have come up with a macro to hide the columns in which there was a zero value. It also unhides the columns when the value is not zero.(I had the data in a row, for the filter they had to be in a column)



Sub HideColIfZero()
'Hides column(s) with zero so chart does not show zero or it's coresponding label entry.

For Each C In Worksheets("Sheet1").Range("S2:Z2")
If C.Value = 0 Then
C.Activate
Selection.EntireColumn.Hidden = True

End If

Next C

For Each C In Worksheets("Sheet1").Range("S2:Z2")
If C.Value <> 0 Then
C.Activate
Selection.EntireColumn.Hidden = False

End If

Next C

End Sub
 

Forum statistics

Threads
1,144,741
Messages
5,726,010
Members
422,652
Latest member
Elnene1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top