Omit $0.00 When Creating a Chart

GarySmith

New Member
Joined
Apr 13, 2013
Messages
30
I've searched high and low for this one. Can you help? I don't want to include the $0.00 values when charting this list. Idea?

Here a screen shot of the sample list:

Test_Chart_2-e1367628779350.jpg




Here's the data range. Is this where I edit to get the range to omit a zero value in the list?

Test_Chart.jpg
 
This short video shows that I have a range named "Totals" (and that could be any range, actually) and that we can create a maco (see previous comments) that will hide any zero from the chart with the "Hide Row" function.

A couple of questions now:
  1. When we use Hide Row (manually), we must manually "UnHide Row" to get the graph to show the new totals that may have been added to the range (see video).
  2. How (if its possible) can we get the column to show "new data", as it's added to the range when it's reference into the "now hidden rows".

Somehow, we'll need to set an "If" statement to show rows in a range, if and when the column in the range has data > 0. Once that happen, the graph will show the visible rows and their values.

Does that make sense?
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
This short video shows that I have a range named "Totals" (and that could be any range, actually) and that we can create a maco (see previous comments) that will hide any zero from the chart with the "Hide Row" function.

A couple of questions now:
  1. When we use Hide Row (manually), we must manually "UnHide Row" to get the graph to show the new totals that may have been added to the range (see video).
  2. How (if its possible) can we get the column to show "new data", as it's added to the range when it's reference into the "now hidden rows".

Somehow, we'll need to set an "If" statement to show rows in a range, if and when the column in the range has data > 0. Once that happen, the graph will show the visible rows and their values.

Does that make sense?

I'm definitely not the best person for this, as I'm not super familiar with Macros, but this seems to work. I added an ELSE to the If statement, for cases when the cell does NOT equal 0, it will show the row.


Code:
Sub HideRows()
Dim cell As Range
    For Each cell In Range("B1:B7")

If UCase(cell.Value) = "0" Then
    cell.EntireRow.Hidden = True
 Else
    cell.EntireRow.Hidden = False
End If
Next
End Sub

Once you replace your current hide rows macro with this, go to your developer tab and insert a button to regenerate the chart (assign it to the macro).
 
Upvote 0
you did not reply to my question - I repeat it, if you have 8 data values, and 3 are 0.00, do you want a bar chart with just 5 bars?
 
Upvote 0
Yes to answer your question about visible bars remaining. Please watch the video above to see that I want a new chart to show the current line totals if changed in the reference page. Maybe that action could be rendered upon worksheet entry?
 
Upvote 0
I had a similar issue. What I did was add a "Lock Sheet" checkbox, so that after you've entered all your data, you check the box and the sheet with run a "hide rows" macro to hide rows with zeros and then protect the sheet. Then, when you want to change the data, you can uncheck the box which unprotects the sheet and then runs ActiveSheet.Cells.EntireRow.Hidden = False make all rows unhidden again. This will allow it to unhide the rows because it selects every cell in the sheet. However, it may not be very ideal if you plan on having a lot of rows with zeros, which might be kind of overwelming.
 
Upvote 0
I had a similar issue. What I did was add a "Lock Sheet" checkbox, so that after you've entered all your data, you check the box and the sheet with run a "hide rows" macro to hide rows with zeros and then protect the sheet. Then, when you want to change the data, you can uncheck the box which unprotects the sheet and then runs ActiveSheet.Cells.EntireRow.Hidden = False make all rows unhidden again. This will allow it to unhide the rows because it selects every cell in the sheet. However, it may not be very ideal if you plan on having a lot of rows with zeros, which might be kind of overwelming.


Thanks...I'll give that a try!
 
Upvote 0
itemdescriptionnumbernumberplus
1text155.0000001 00
2text200 00
3text399.0000003 00
4text444.0000004 00
5text500text44.000000441text15
6text600text74.000000773text39
7text744.0000007text15.000000114text44
8text877.0000008text87.000000887text74
9text900text108.000001108text87
10text1088.000001text39.0000003310text105
A SERIES OF LOGICAL OPERATIONS SORTS THE DATA UNTIL IT IS IN ORDER BUT AT THE BOTTOM OF THE LAST BLOCK. Selecting all 10 rows AND BOTH COLUMNS of the LAST block and constructing your bar chart will only plot the non blank items as you requested. NO MACROS INVOLVED.

<colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,632
Messages
6,120,649
Members
448,975
Latest member
sweeberry

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
Back
Top