Excel Macro For Charts In PIE Chart?
Jan 28, 2013i am creating a macro to animate the charts, but i need a code where, if i select a block in the chart it should take the point name automatically.
View 1 Repliesi am creating a macro to animate the charts, but i need a code where, if i select a block in the chart it should take the point name automatically.
View 1 RepliesI have a code for auto scaling charts, but I'm looking for a slight tweak to improve its performance. Here is the code:
Public Sub ChartScale()With ActiveChart.Axes(xlValue).MinimumScale = Range("J152").MaximumScale = Range("J153")End WithEnd Sub
(where J152 and J153 are the cells being used to scale the chart)
What happens is that I create a macro button, and then have to select a specific chart, then press the button to scale it. I have 2 main questions I'm trying to have answered to improve this process:
1) Is there a way to make this process automatic (i.e. no button press required)? The chart would autoscale automatically upon the min and max number changing.
2) And more importantly, can I specify the macro to an individual chart instead of the active one? For example, I'd like 4 charts on one sheet to all have their own auto scaling being performed. So, in the above code, the chart uses cells J152 and J153 for the scaling. I'd like the others to use other cells for the scaling. Cells J152 and J153 would auto scale chart "Name 1", cells K152 and K153 would autoscale Chart "Name 2", and so forth for 4 charts.
I have an excel which creates PPT from the excel. but the graph pasted in PPT are not aligned and formatted.
By aligned, i mean re-size the graph and paste in a formatted fashion (currently they are overlapping each other)
My entire PPT created is off alignment and formatting. E.g heading are not properly aligned (they are touching the line below) and so on.
I've got quite of few excel charts to make and have been looking for a way to automate the process. The chart types include line, pie, and bar. Basically, I have data for each state in the US that I am comparing with national level data. Thus each chart will have national level data and the data for each state. What I need is a macro that I can easily change the parameters for because different worksheets have slightly different layouts. I started by using the macro recorder to make a chart. Then I attempted to edit it so that it would run loops to make additional charts. Below is some sample data for the first worksheet I have and my attempted macro.
Sample Data:
Code:
State Characteristic Value07 Value08 Value09
Alaska A 11 23 45
Alaska B 13 22 98
Alaska C 99 91 21
Alabama A 23 14 11
Alabama B 44 62 76
Alabama C 75 47 21[code]....
This code doesn't run at all.
I've been using a VBA code to look through my spreadsheet and find any graphs in any tab and move it to powerpoint. I have about 70 tabs with 7 graphs each.
I have is that the order of the graphs in the slidepack isn't in the same as found on each excel tab.I also tried renaming them (chart1-chart7) but problem still remains.
I am trying to graph the following data in an area chart with line charts superimposed on the area chart. I have a lot of data (and a lot going on) so I'm trying to figure out the best way to show this in excel from a functional standpoing (i can't get this to work in excel!!) to also an asthetic standpoint (dont want it to look terrible or illegible). This is what I'm trying to chart:
1) Weather data (temperature) by region:
So one region, would be: Northwest
I would like the "area" (so a shaded region) to be the min/max of the temperature data for each month.
2) I would like to show the temperature for each year as a line graph on the chart - so you can see if a year falls in or out of the shaded region.
3) I would like to show a company's sales increases across the same months per year as separate line charts. I may choose to just show the biggest outlier year in the end... or to show 2006 (the latest data).
What I am trying to convery with the chart is that the company's sales is or is not tied to weather deviations. I have attached an excel file with the data. I haven't been able to use the area chart or get a two axis chart to work or get it to look even remotely professional.
Is it possible to build 1 chart that holds 2 different pie charts? If possible I need to do this with VBA. The pie charts will have the same "components" the only thing that would vary is the percentage of each component (some values will be zero in one of the charts).
View 2 Replies View RelatedI would like to use multiple scatter plots and bar charts in one chart. Problem is that X-Axis goes horribly wrong every time, even if I have same points on both scatter and bar. Here is Data for 2 Scatter Plots
XScatter1
1,43 0,14
2,60 0,25
3,04 0,37
3,60 0,50
3,93 0,60
4,69 0,80
X Scatter2
5,10 0,92
5,36 1,00
6,43 1,26
7,60 1,53
8,19 1,65
8,79 1,77
9,69 1,93
And here is data for 2 Bar Charts
XBar Chart1Bar Chart2
1,43#N/A 0,00
2,60#N/A 0,01
3,040,01 0,01
3,60#N/A 0,01
3,93#N/A 0,01
4,69#N/A 0,00
5,100,02 0,01
5,36#N/A 0,01
6,43#N/A 0,02
7,600,04 0,02
8,19#N/A 0,01
8,790,11 0,02
9,69#N/A 0,01
I start with Scatterplot and put those in the graph, then I add other data and change it to Bar Chart, but this is the point where X-Axis gets mixed up and scatter plot X data and Bar chart X data are not matching.
I have a sheet with about 50-60 charts and I am hoping to have a master list of chart titles on the side, how can I link these titles with the charts themselves?
View 1 Replies View RelatedI have created a line chart that plots weight of a person, but want to show on the plot area what a certain range of weight represent, Ive attached images to show this concept.
View 4 Replies View RelatedSheet1 contains a chart using a dynamic name in Source Data: Values. The dynamic name data is controlled by another cell. When I copy the sheet - i.e. Sheet1 (2) - and change the control cell, the Source Data: Values in the copied sheet still refers to the original Sheet1.
View 3 Replies View RelatedI have 6 columns. The 5th and 6th columns are the most important. The 5th contains a figure and the 6th contains a type.
Bascially I am trying to do a basic chart showing the following 2 things. A. Do a percentage chart of column 6 (service) but not of percentage of hoem many lines the product is in. Not based on percentage of how many times Apples are shown compared to other products. I need it to add up everything, then do a percentage of total amounts of oranges and total of for Apples from the figures on column 5. Also, if possible, the pie chart will even show teh actual total figure per product in each (or next to) each pie chart slice.
know the easiest way to do this (step by step) in Excel 2010 and then I can perhaps write a macro for the future?
Trying to create a macro to run through the following steps when I select a chart and run the macro:
Paste>As Picture>Copy As Picture>As Shown When Printed>OK
I used the macro record feature and when I enter the shortcut it always returns the same chart. How do I get it to run on whatever chart I have selected instead?
I am constantly using this function to copy charts from Excel into PowerPoint presentations and am frustrated with all the extra steps it takes (versus just Ctrl-C).
I am working on a project where I am virtually almost finished except for a minor change with the pie chart. I am analyzing some data and recorded a macro to do this and also the pie chart for visualization. However, I do not like the color of the default pie chart colors and would like to customize it. How could I change this within the macro I have recorded?
[Code] .....
I need to plot various data on top of stock charts.
This data could be irregular in date: it could be weekly, or simply random.
To plot this data by itself requires a Scatter Chart.
From what I know so far, you CANNOT DO THIS.
However, I suspect this could be done if I build a Stock Chart from scratch using a Scatter Chart.
Error bars can be used to make the tails, however, I don't know how they built the body bar which has the characteristics of a bar (border, and interior.)
But since I don't really need those two characteristics, I just need a wider error bar line that is provided in the chart edit window. I'm guess through a macro, there are wider line widths assignable.
I am looking for a creative way to display a pie chart within a data point marker of a line chart.
My database has 3 value columns, Type1, Type2 and the Total (Type1 + Type2)
these are recorded per day (Date, in Column A)
I have a line chart that displays the total by date, but I want to find a way to display the percentage split of a particular day by type.
I was thinking to load the chart image into the Data point marker, but i don't think that is the best way as the data is updated daily and I would have to do it each day for a few line charts.
The other way I was thinking about was to have a generic Pie chat in the Line chart (Maybe in a corner) and the pie would update depending on way date series was selected or Mouseover'd)
the way that I am approaching it at the movement (Not the best way and by far not the coolest way. Is to have a list of all the dates in a column next to the Line chart and using some VBA, what ever date is selected in the column the pie chart displays the corresponding data. But eh challenge is that when there is alot of dates, I am going to be scrolling up and down.
I am using Excel 2010, but I cant not use the slicer's as the other users do not have 2010, they have 2007.
I have a spreadsheet created in Excel 2003 (which is what we use at work, unfortunately).
My employees periodically take a test to ensure they have certain items memorized (or are making progress to that end). The spreadsheet rows show all 46 of my employees, and their test scores. The columns are the dates that the tests are administered. I can create a line graph based on the chart data, and interpolate these data with no problems.
The problem is that there are 46 employees! 46 lines on the same graph make for a very cluttered, hard to understand visual. I want to simplify the view by "filtering out" some of the data.
I have an additional column in my spreadsheet for each employee's work area (Area 1, Area 2, etc), and another column with data based on first letter of last name (the values here could be "A-G", "H-M", "N-S" and "T-Z", for example). I figure i could filter my line graph based on these two columns. For example, somehow select just Area 1, and reduce the number of lines on the graph to 16. Or better yet, Choose "Area 2" AND "A-M" and end up with 7 employees (and therefore 7 lines on the graph).
Here's what i have tried:
1) Select the work area column, and use the Filter, which created a drop-down list at the column heading. When i use this drop-down list, i can easily filter the data in the worksheet by Work Area, but this is not reflected in the line graph, which still shows all 46 lines. The problem was that i forgot that i had set the Calculation Options to "Manual". Setting this to "Automatic" (or leaving it on Manual and pressing F9) solved the problem, as the chart now updates when i use the filters. Calculation options are under the "Formula" tab in 2007, or in Tools -> Options -> [either calculation or formula, i forget what it's called] in 2003.
2) Create several separate line graphs in several separate sheets. I wouldn't want to assign someone else the task of maintaining a spreadsheet of such inefficient design.
I would like to know is it possible to overlap the data & view it as Chart format.
View 1 Replies View RelatedI know this has been discussed a number of times, but here is my problem
I have three charts in my workbook. I want to attach a macro so that when the chart is clicked it returns to Sheet - Home. I have using the following:
worksheets("Home").activate. But after I protect each chart and the workbook, and save and exit. When I reload the Workbook it has forgotten the assigned macros and nothing happens.
I have to enter data into a spreadsheet daily and update a line graph with the data for 10 different production machines. I want to place the charts on their own separate excel file that way they can be easily viewed without the data next to them. I tried copying and pasting the graphs to another excel spreadsheet, but when I update the graphs on the original excel file the data does not change on the one I copied the graphs to. I use the select data range option to update the line graph data. Basically, I just want both graphs to update at the same time on both spreadsheets, but the links don't seem to update. How would I link the graphs so that both update across files?
View 2 Replies View RelatedI'm currently working on a spreadsheet for my husbands work in a school environment. All was going well until I hit a wall with the alphanumeric data of the current uk stats system. Is there any way of getting my 4c...4b...4a...etc. to chart?
View 1 Replies View RelatedI have a simple problem. I have many worksheets which all contain data in the first four columns. I want to be able to create a chart (a scatter chart) in the first worksheet which plots the data on that worksheet and then format it how I want it to look. This I can do.
Next, I want to copy and paste that graph into all the other worksheets, but have the pasted graphs display the data in that worksheet.
As it stands, in Excel 2010, all the pasted graphs keep showing the data in the original worksheet irrespective of which worksheet I now have them in. This seems to be different to older versions of Excel and is very annoying and has to be changed by hand which is very time consuming.
How can I make charts that don't have the worksheet name in the cell reference, or how can I paste a chart so that is updates the references to the same row and column but in the new worksheet?
I know I could copy and paste the entire worksheet and then manually copy the new data into that copy of the worksheet - but that is not a real solution to this problem.
I have two line charts in Excel 2007.
One chart has the values going down from upper left to lower right
The other chart has the values going up from lower left to upper right
Is there anyway to merge these charts to see if they intersect at all?
I need to transfer data to powerpoint from my '4 box' reports in excel.
Essentially copying everything in the range A40:U74 inc charts and paste them into a slide as a picture on the click of a macro button.
I have to do alot of reports like this for my project and it takes up alot of time copying and pasting etc.
I have seen different codes for this but they are either for charts only or text... the one i did see for both, didnt work at all.
I want to prepare a graph / chart for the column A and column B. Column A has headers and B has the data that I want to represent in the graphs. The real problem in this is that the two columns length is not fixed. For eg. for January Column A & B could have 5 rows of data but for February they could have 10 rows of data. I dont want to prepare the chart manually every month. I want that if we could apply any VBA coomands that could prepare the chart automatically irrespective of the rows count.
View 9 Replies View RelatedI am trying to write a macro that goes in an excel file that creates a powerpoint presentation, and puts four (4) charts in each slide.. I currently have a code that is pasting all of the charts in the same slide and I can't figure out why it isn't working (side note: I haven't attempted to resize or relocate the pictures on the powerpoint slides yet)..
Code:
'Add a reference to the Microsoft PowerPoint Library by:
'1. Go to Tools in the VBA menu
'2. Click on Reference
'3. Scroll down to Microsoft PowerPoint X.0 Object Library, check the box, and press Okay
'keep button in same location
Set btn = ActiveSheet.Shapes("CommandButton17")
With btn
btLeft = .Left
btTop = .Top
End With
[code]....
I've prepared an excel file (excel 2007) with some tabs that contains several charts (4 to 6 charts). When I want to print this file, the sheets with the charts on it doesn't print properly. I have set the print area to cover the charts only and then set it to fit on 1 page but the charts will not scale to fit.
I read somewhere that this is an excel bug - is there a workaround for this?
I could resize all my charts smaller but only as a last resort.
I am new to macros and I am trying to export 20 charts that are one worksheet. I found the code below online and it it does work for a majority of the charts. However, it randomly skips some of the charts and does not export the. I receive an Run Time error 76; Path not found. Each chart is named.
Sub Create_Png()
Dim objCht As ChartObject
Dim strPath As String
strPath = "C:Path Name"
For Each objCht In ActiveSheet.ChartObjects
objCht.Chart.Export strPath & objCht.Name & ".png", FilterName:="png"
Next
End Su
I have the following piece of code to hide all worksheets in my workbook but modify it to hide the multiple charts I still have open after running this:
Code:
Sub HideAllSheets()
Application.ScreenUpdating = False
Dim ws As Worksheet
[Code].....
I am trying to rename a chart in Excel 2013, but it keeps reverting my names. It looks like there might be a 32 character limit on the name length, but I cannot find any documentation supporting this.
In case it's not clear, I'm trying to rename a chart from Chart38 to "Productivity - Tractors CY/OP - Month", but once I press Enter, it changes back to Chart38. If I can shorten the name to less than 32 chars it seems to work, but that will be nearly impossible for some other charts.