Chart/Graph Changing/Variable Range
May 28, 2008
I have a vast database where I have linked charts. I send the data from a macro to the database and sometimes there are 1000 inputs and sometimes there are only 20.
How would i set up my charts to only graph the inputs that are present?
View 7 Replies
ADVERTISEMENT
Apr 25, 2008
I have a database in excel with a lot of tables in which lets a uses a combo box so the user select can view just one table.
I want to be able to create a macro so when a button is pressed, it copies the data into a new workbook and creates a chart so they can do whatever they want without disrupting anything in the original workbook.
I have been able to find code that will export the data and create a chart (see below) but the problem is the range changes from table to table so I need to find a way of changing how the chart picks up the data range.
Sub Chart_New_Book()
Sheets("Temp").Select
Cells.Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Range("A1").Select
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:C10")
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
End Sub
So at the moment when charting ony cells A1:C10 will be plotted no matter what the size of the table is and making the target range bigger only sees the blank cells being plotted.
View 3 Replies
View Related
Aug 28, 2012
I work with a team of users that are continually publishing reports in Word that contain charts and graphs copy and pasted from Excel into Word 2010.
We have a custom script that leverages a PDF engine to automatically convert .doc files to .PDF files that we distribute electronically to our clients. This all works great, but only if all my users select 'paste special' and Enhanced Metafile Format when adding their excel charts into our reports. Most of these people aren't tech savvy, and I'm havin ga hell of a time getting them to follow this workflow and am hoping there's a way in Office 2010 to select the default paste from excel into word when the content is a chart.
It seems like the default paste from excel is an embedded chart/graph that you can then further manipulate each component of the chart in Word; the default doesnt' paste an actual image. I am assuming the pdf renderer is using a lower resolution .PNG version of the image and when these are scaled for print and or pdf, they look like crap.
Is htere anyway I can automatically change the default paste format for the chart from excel into word to be an EMF/EMV (enhanced metafile?) Either thorugh the registry or some other saveable setting?
View 1 Replies
View Related
Sep 8, 2006
I am trying to create a graph for a range of data that updates monthly (adding an extra month each time). I wanted the graph source data to update automatically each time the data is refreshed so used an OFFSET formula to identify a named range. I then point the graph to the named range as the source data.
When I enter the range as the source data the graph picks it up. However, when I re-enter the source data option on the graph it has converted the named range into a cell written range (ie. replaces "=QUALITY" with "='Front page'!$B$7:$J$10" - which therefore will not update when the range increases.
View 4 Replies
View Related
Sep 4, 2006
I am trying to automate a graph for data that is not always the same amount but always in the same format. I have attached a spreadsheet that has an example of the data.
Columns B, D, & E are the ones that I am interested in charting in a line with markers type graph, but the rows may be 100 for one set of data and 1000 rows for another set of data. I am trying to get the macro to open a new worksheet and as part of the macro create a userform that will ask for the text information on the top of the worksheet (as this is not always correct when imported).
View 5 Replies
View Related
Aug 21, 2008
I have a Line Graph with 2 lines on it. Is it possible to write a macro to extend the range (Source range) of one of the lines ? I would also like to add a Data Label to the newly added point.
For e.g. If I have Line 1 graph only till 65, I want the macro to extend the range by one row to include 95 and also display a datalabel ......
View 9 Replies
View Related
Jul 23, 2008
I need to select data from columns A, B and I for the graph. I have the below code but get an error message. Can anybody help ?
Set cellGR1 = Cells(2, 1)
Set cellGR2 = Cells(K, 2)
Set cellGR3 = Cells(2, 10)
Set cellGR4 = Cells(K, 10)
Charts.Add ....
View 9 Replies
View Related
Apr 24, 2006
I want to have the "category (x) axis label" to change with each new entry into column A. I would like to start from the last entry and go back 30 and have that change each time there is a new entry. I guess what I am trying to say is I only want to chart the last 30 entries.
View 2 Replies
View Related
Jul 14, 2014
I have a workbook, with 2 sheets. first page has graphs, second has data. in my charts I refer to a named range on the second one as follows: Data!Named_Range, where "Data" is the name of the second sheet. However when i save this, it changes the range of the chart to: '101044.xlsm'!Named_Range, where 101044 is the name of the workbook. This is a problem for me as this workbook will often be loaded into a document handling system where the file will change name, throwing out all sorts of errors because the chart path is invalid, and i have to change the range of all the charts manually. why does it have to use the file name when reffering inside the same workbook? and how do i force this to not change?
View 5 Replies
View Related
Oct 24, 2006
I have a chart updating on a weekly basis
a) can i select a whole range without the chart picking up any blank cells or zeros, if so then a lot of my other question will be redundant
b) I only want to show 4 weeks at a time, so when a new column of data is added on, how do i get VBA to shift the range accross 1 to the right e.g.
week 36 37 38 39
Shift to
week 37 38 39 40
View 5 Replies
View Related
Jan 17, 2009
I have some code that uses offset to select a column of numbers
View 2 Replies
View Related
May 11, 2009
I am trying to find the max value within a range (14 cells) contained in one column ("C" in this case). This range will change corresponding to the current cell. Ex. as the current cell moves down (or increases in number) the range of cells to find the Max in moves down (or increases in number) as well. The Max value will then be used as a variable in a equation but for now just getting it into a cell is fine. This seems like it would be easy but it is driving me absolutely batty!
I currently have the non-working code located in a For loop that contains other calculations as well. I've taken those calculations out since they work fine but cloud the bad part. So far I have tried:
View 3 Replies
View Related
Nov 30, 2006
Each week I have to add a new column to a report and then update the source data of all the charts that use that newly added column. I am trying to create a macro that will use the last 12 columns of data located on a different worksheet as the range for the source data of the chart. I have attached an excel document that contains an example of how one of the charts that I am using looks and where it pulls the data from.
View 3 Replies
View Related
Feb 22, 2010
I am fairly new to using vba in excel, but not vba entirely so I know there is a way to accomplish what I need. I need to specify the range for a chart using variables
1. The row variable will be a selection on a combo box
2. The column variables will be mulitple selections on a list box
3. These cells will not be concurrent, for example:
I6, K6, O6
This is all in a vba macro button
View 2 Replies
View Related
Feb 27, 2012
I recorded a simple macro to create a chart using VBA. The code for the macro is:
Code:
Sub Add_Chart1()
'
' Add_Chart1 Macro
'
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlLine
[code]....
The problem is that I need the code to select a variable range from C4 to the last used row in column C for the x values and from G4 to the last used value in column G.
I tried to modify the code to do that by doing the following:
Code:
Sub Add_Chart1()
'
' Add_Chart1 Macro
'
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlLine
[code]....
When I run the macro, I get an error 91, "Object variable or With block variable not set"; Also the chart is created but not correctly.
I created a sub called "range" (see below) and it correctly selects selects the C or G ranges, however, the argument does work in the chart macro.
Code:
Sub Range()
Sheets("Sheet1").Range("C4:C" & Sheets("Sheet1").Range("C" & Rows.Count).End(xlUp).Row).Select
Sheets("Sheet1").Range("G4:G" & Sheets("Sheet1").Range("G" & Rows.Count).End(xlUp).Row).Select
End Sub
View 2 Replies
View Related
Nov 19, 2009
I'm trying to write some code to make an existing chart display the correct series of data. However, on the ".SeriesCollection..." lines, it gives me the error "Object does not support this property or method." I'm using a Bar-Line graph, if it makes any difference.
View 5 Replies
View Related
Dec 29, 2011
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.
View 1 Replies
View Related
May 23, 2008
I have data which is imported from a txt file and always starts at the same row (R19) but is variable in length (end of data R??). I want to be able to select the chart xvalues (R19C10:R?C10) and values (R19C4:R?C4) based on the number of cells with data in them for a given column. In addition I believe I'm having troubles with sheet references, when the txt file is opened the sheet name is set to the file name, since I want to use this macro on many different files I need the sheet referencing code to account for this. Anyway here is the section of code which seems to be giving me trouble (the initial sections just create a new column of data which needs to be referenced as the xvalues) ...
View 3 Replies
View Related
Apr 8, 2012
I am able to change the X-Axis with:
Code:
ActiveChart.Axes(xlCategory).TicketLables.Orientation = 45
How I change the Y-Axis?
View 1 Replies
View Related
Nov 1, 2006
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.
View 3 Replies
View Related
Mar 27, 2012
I would like to change the color of my text on my X-axis of a graph. I would like to have 4 or 5 different colors to identify different categories. I see how I can change all the text but how would I change just the text in column 1-3 to red, column 4-7 to blue, etc...
View 2 Replies
View Related
Jun 17, 2007
I have a normal line graph I would like to see plotted vertically rather than the normal horizontal layout. In other words, points/lines would appear around a vertical axis and go from side to side. The normal graph would look as if it was tipped on its left side.
View 9 Replies
View Related
Jul 19, 2012
My question is regarding changing properties in a chart without activating it. My current example is with adding data labels, but there are many other instances I could use this information in. Here is my current code:
VB: ActiveChart.SeriesCollection(2).ApplyDataLabels
However, I was hoping to replace it with something like this:
VB: Sheets("Dashboard").ChartObjects("Chart 1").SeriesCollection(2).ApplyDataLabels
I get the "Object doesn't support this property/method" error. Is there a way to do this? It just seems inefficient to have to activate the chart in order to make changes.
View 2 Replies
View Related
Mar 26, 2014
I have hundreds of column graphs, how do I quickly change the size of them to the exact same size of 8.1cm height and 26.4cm width.
View 1 Replies
View Related
Feb 4, 2010
I want to carry out a survey in Sept, Oct and Nov. I will asking 1000 random people in each survey what is their personal favourite--- iPhone, Nexus or Blackberry. Counts of each phone type is then divided into male and female.
Now we have three variables: gender, phone type and month. Is there any way I can present 3 variables on X, Y & Z axes and the value at their intersection as bubble size (or colour gradient)? Theoretically it's possible but I can't find a way to do it in excel. Or anyone knows any software that can get the job done?
View 10 Replies
View Related
Oct 26, 2009
I have created some charts for my work and one of them is a line chart that spreads across one year with values for each month. Well they want the graph to always show one month ahead of where we are out. So there is actuals in for Sep. but then the line graph drops all the way to 0 for Oct. I don't want to have the graph bottom out when there is a zero. Does anyone know how to fix this?
View 9 Replies
View Related
Dec 18, 2006
I was tracking down simple ways to generate ASCII character based bar charts and came across this stunningIncellBarChartExample where the author suggested this can be done using VBA code.
I am very new to Excel and EXCEL VBA. Can someone help me sketch how the coding for the above example (include mixed colors) might be done? Is there a special font that need to be used?
View 3 Replies
View Related
Sep 11, 2007
I need to plot percentages over time in a line graph in excel. I don't want to have to do a percentage equation in the spreadsheet, I just want excel to take two sets of values and display the percentage in the chart. For example, I need B1 as a percentage of B2 for week 1, C1 as a percentage of C2 for week 2, etc....
View 3 Replies
View Related
Mar 12, 2008
How can I create a box chart showing graphically a median, 1st and 3rd quartile and a minimum and a maximum?
View 5 Replies
View Related
Apr 23, 2008
is it possible to rotate a graph. i need to turn my stacked cone graph upside-down so that the point is facing down and not up
View 2 Replies
View Related