I experienced a problem where the pie chart in Excel went completely blank because I edited the "source data" to include some blank rows. I expanded that source data because I thought it might be populated later. I needed a dynamic chart that would be able to include additional data.
Rather than using Index or Offset for a dynamic range (which didn't work for me), I found another solution which I would like share.
Instead of editing a pre-existing chart to increase its range to include blank rows, it is necessary to populate those blank rows with dummy data. Then make a new chart based on the range that includes this dummy data.
Now, by deleting the dummy data, the accepted range will still be intact in case real data is added at a later time.
The real problem appears to be how "select data" works on empty cells after a pie chart has been created.
For example:
Related
I am working on an excel add in, and need to show data in chart. I am facing a problem to set data for chart as it is not in a range. I am showing only first 10 columns in chart.
I am using WorkSheet.charts.add() function to add a new chart, however it takes data as range only. My x-axis is very first row of the sheet, but data for Y-Axis can be any row selected by user. For example if user selected row 7, then I cannot create a range from "A1:J1, A7:J7" as per my understanding range must be connected cells. If I create a range "A1:J7", it shows data of other rows and I am unable to find a way to remove/hide that data. I can do it manually using Chart options from menu, but cannot find a way to do so in API.
The technique for doing this is to copy the data that should be in the chart to a range on a hidden worksheet. Then pass that range to the Worksheet.charts.add() function. There is a sample add-in that shows how to do this: Excel Add-in JavaScript Sales Tracker.
I have used Excel for quite some time now but only using traditional formulas. Now I am trying to create a more elaborated document for my business using VBA coding to expand my possibilities.
I have done some research and started practicing but found something that I can’t understand how to do yet.
I have a worksheet with a table on it. Since this is a fresh document it has nothing but the header and a blank row below it. What I always did when writing the information was type text in any of the columns that belong to the row immediately below the table (without actually inserting a new row myself). This creates a new row for the table where most of its format is kept, such as text size and formulas. However, I noticed that the row height doesn’t automatically change to that of the previous rows of the table, and changing it manually for each new row is very time consuming.
I would really appreciate it if anyone could share me the necessary Excel VBA code to fix this issue. I have thought of two possible approaches. The first one is a code that automatically sets all the rows of the table to a height of 20 (I want all rows to be the same size so no problem with that), supposing this would also affect new rows as I add them the way I mentioned. The second one would be a code that automatically sets every new row of the table to a size of 20. It doesn’t matter which one you choose, the easiest will be just fine. Thanks in advance.
I have a complex workbook full of formulas linking back to a set of tabs at the beginning which contain the source data.
Currently that data is stored as a static set of data. I want to replace it with a dynamic external connection. Problem is, when I load up the table it "helpfully" shunts the existing static data to the side, and all the formulas in the workbook "helpfully" update to reflect that- so they point to the old data in the new cells, not my new table!
Is there any way to either
A) overwrite the cells rather than inserting extra extra columns
B) Long shot- temporarily Excel updating formulas?
I think that this question is similar to mine, but has no useful advice for my situation - I don't want to and probably can't manually update every formula range.
Thanks.
After some experimenting it turns out the inserting of extra columns only takes place if data is present in the cells you are going to overwrite.
So deleting the data (NOT the cells) and then loading the query to the now clean area will work fine- formulae in the rest of the workbook will continue to link to the table.
I have created a chart which is dependent on a table of data, where the data range contracts and expands according to user input. There is a cell where the user can input how many months the chart range should be and the data table that the chart is connected to pulls the corresponding range of data from a different, master data table.
So my issue is that, when the chart data table contracts, the chart does not adjust. There is no issue with the chart data table expanding, only when the chart data table contracts, as it should be able to. The issue is even more strange because usually I can fiddle with a setting briefly and then the chart will update. For instance, i can go to Select Data on the chart and then hit cancel and the chart updates. Or I can change chart type to the same it already was, and the chart will update. So why is it that the chart does not initially update when the data in its range change?
Also, I would prefer to not use VBA on this due to the file sizes with which I am working. Is there a trick to getting this to work in Excel?
Below is an image of what I'm referring to:
I have got two adjacent tables. When I apply data filter on first table, it filters the whole row hiding rows from 2nd table as well. How do I restrict filter to only the first table range?
To answer your direct question How do I restrict filter to only the first table range? the answer is - you can't.
Reading the comments it seems what you need is to display the filtered table data next to a chart and another table. There is a little know tool in Excel that you can use to achieve this - the Camera Tool. With this you can create a dynamic image of a range and place it where you want. The image updates when a filter is applied to the source range, without affecting the rows on the Dashboard sheet.
Screenshots to demonstrate:
Setup with tables on seperate sheets, and camera images beside chart on dashboard sheet
With Filter applied to Table A
The Camera tool is not on the Ribbon (Excel 2010) or the standard toolbars (Excel 2003). You need to add it using Customisation. (Add to Qucik Access Toolbar in 2010 or Tools/Customisation Menu in 2003)
Unfortunately you won't be able to do that. When you filter, it filters the entire row (something to think about would be how the row number would display if that weren't the case). You will need to restructure your setup if you wish to prevent that (not sure of your particular use case, so sorry I can't give a more specific suggestion).
I had a similar issue, where i had a table I wanted to remain static - like a key, but wanted to filter the main table.
To get around this, I copied the static table, and pasted it as an image. This way, when you filter on the main table, the image remains where you have put it.
A simple workaround for this general issue that others may have mentioned (but I don't see here):
You can't filter just a range (e.g. a few columns in a spreadsheet), but you can sort just a range. And by sorting the range, then deleting some blocks of unwanted cells in the range, then sorting the range back to the original order, you can fake a filter.
A bit clunky, but easy for some jobs if you're careful.