VB:
With Sheets("Graph").ChartObjects("Chart 3")
.Activate
.Chart.SeriesCollection(1).XValues = Sheets("Data").Range("D2:D" & Sheets("Data").Cells(Rows.Count, "D").End(xlUp).Row)
.Chart.SeriesCollection(1).Values = Sheets("Data").Range("E2:E" & Sheets("Data").Cells(Rows.Count, "E").End(xlUp).Row)
.Chart.SeriesCollection(1).(What Do I put here To Set the color of the line)
End With
1) i have office 2003 on a laptop. within powerpoint, i can create a 'microsoft excel chart 11' object. to create a link to the excel data source, do i have to go through the odbc sql setup? it works, but i don't want my powerpoint to be dependent on some excel file somewhere. what are the other options to insert/make a functional pivot chart in powerpoint with the data also within powerpoint? the data as sheet option does not result in the chart being a pivot, it's just a plain chart. it has to be a proper object, not an image paste or a chart that updates links with the excel file open.
2) i have office 2007 on my other laptop. i can not find any suitable object to choose from to make a pivot chart in powerpoint. what's the best way to go about in 2007 version?
3) am i going about this the wrong way with the objects? should i be after vba code?
I have a range of cells that change colors with conditional formats based on the cell value from high to low. I would like to link the cell color to an object such as a circle or rectangle. When the cell value changes along with the conditional format, the color of the object will also change.
I'm looking for the excel model object chart and class diagram. I find the model object's description in the microsoft page, however i'm liked to have the object model and the class diagram in chart or picture.
if it actually possible to colour data points depending on the colour of the cell of the data it refers to? if not is it possible to colour it any other way i have uneven amounts of data for weach month but still want the months to be displayed, this is the best way i can think of of doing this
I want to be able to link the colors of 8 differnet TABS of individual worksheets that have each been colored differently to the colors of individual columns of a chart - being a summary chart of information in another worksheet that has come from seperate worksheets within the same workbook. So that if someone was to change the color of any tab then the color of the corrosponding color of a column in the chart would change automatically if the color of a TAB is changed.
I have a MS Office Chart Component (11) on a userform. I am trying to programatically change the item in the filter (page) area (only one field) using VBA. The source is an OLAP cube ( SQL AS 05) but don't think that's particularly relavent because I can't do it even if the source is a range.
The object comes as a ChartSpace on the userform. I have found a reference (using the watch window) to the current filter selection in ChartSpacex.InternatPivotTable.ActiveView.Fieldsets(0).Fields(0)....
I wrote a macro that selects 3 charts existing in a sheet and sets the axes to auto scale option. The charts are labeled Chart 2, Chart 6 and Chart 7 by default, the macro selects each of then and then sets the auto scale option.
Is it possible to use 'If then' statement to check if the chart object exists ? In case they do exist then macro works on them but if not then it goes to the next statement.
Or is there any other way to check if objects exists or not, because sometimes the macro is used for old files (template) and the chart objects there have different numbers and not 2, 6 and 7. So to use macro for both templates( new and old) its better to check first. This way the macro becomes more flexible.
I want to use VBA to insert an Organisation Chart in Excel 2007 (ie if I did this manually it would be Insert, SmartArt, Hierarchy), but I cannot find anything on line that shows how to do this in Excel 2007. I know the code for Excel 2003, but that does not work in 2007.
I have a worksheet which is used to display analysis data to the user. The sheet will be further protected with only some cells available to the user. I've used the attached code to retrieve some data from the sheet, clear a bunch of cells to reset the sheet and reset a graph (the graph itself is plotted as a log-log with the 1 to 100 on the Y-axis, hence the resetting of data to 0.5 to push it below the axis and make it invisible ready for later data dumping).
The code worked fine until I protected the worksheet. I have set the charts to unlocked using the format option in the chart area prior to locking. When I run the code though, it stops on the line indicated with the error "Application-defined or object-defined error". I've double checked and Chart 7 is the correct chart, and it is unlocked according to its format properties.
VB:
'get date of survey and equipment number for retrieving the data from the archive dateSurvey = Worksheets("Calculation Page").Range("B2").Value equipNum = Worksheets("Calculation Page").Range("F2").Value 'stop screen updating Application.ScreenUpdating = False
[Code]....
EDIT: Oops, I've just noticed that even if I unprotect the sheet, I get an error on the .select within the seriescollection stating "Method 'Select' of Object 'Series' Failed", and the code worked perfectly before. I'm completely lost now...
I have a text box within a chart tab which is populated with text values from a worksheet within the workbook. That part works fine however i want to be able to achieve the following example:
Current Text: Component Name - Notes
if there are notes against the component name i want the name to remain in black and the notes to change to blue
Aim: Component Name - Notes
If there arn't any notes then for the component name and the "-" to change to a light shade of grey
Aim: Component Name -
There are 26 components, each on their own lines in the textbox so im thinking either a loop where the cell reference is variable eg. ("CY" & i) or using the .find with a variable.
My code so far is:
Code: Sub Chart_Notes_NTCA() Dim i As Long, j As Long, Counted As Long, Total As Long Dim Ans As String, Notes As String Dim Cht As Chart
I have been trying to create a macro in excel to chart a selection of data and to output the chart on the active sheet where the data was taken (as opposed to a named sheet). So basically, I have about 300 worksheets with data, and I would like to have a button on each page that automatically charts that data when clicked, and outputs the chart to the page where the macro was clicked. However, I have not been able to figure out a relative reference that will allow me to make the LocationasObject reference simply the ActiveSheet as opposed to a specifically named sheet. See my code below, which references an output to a worksheet called "Charts". Right now, all of my charts are outputting to the sheet called "Charts", as opposed to the active sheet.
Sub ConsDiscChart() ActiveCell.Offset(29, 11).Range("A1").Select Selection.End(xlToLeft).Select Selection.End(xlToLeft).Select Selection.End(xlToLeft).Select Selection.End(xlToLeft).Select Selection.End(xlToLeft).Select Selection.End(xlToLeft).Select Selection.End(xlUp).Select Selection.End(xlUp).Select Selection.End(xlUp).Select Selection.End(xlUp).Select Selection.End(xlUp).Select Selection.End(xlUp).Select Selection.End(xlDown).Select ActiveCell.Offset(0, 1).Range("A1:B1").Select Range(Selection, Selection.End(xlDown)).Select ActiveCell.Offset(0, -1).Range("A1:C24").Select Charts.Add ActiveChart.ChartType = xlLineMarkers ActiveChart.Location Where:=xlLocationAsObject, Name:="Charts" With ActiveChart .HasTitle = False .Axes(xlCategory, xlPrimary).HasTitle = False .Axes(xlValue, xlPrimary).HasTitle = False End With End Sub
I'd like the tab color for a chart to automatically change to yellow if the value of a cell in another sheet is 1, otherwise stay 'no color'. Actually have several such charts but want each one to take its cue from different cell (I suppose I just copy and adjust the macro?)
I would like to display 50 sequences, S_1 ..S_50, with stacked bars. Every sequence can contain 5 different events, E_1 .. E_5, in a random order. Every event has a certain duration, t. Lets say the first two sequences are as follows (duration time is in brackets)
How do I get Excel to display all Sequences in one graph as a function of time, with the bar-stack-color displaying the kind of event. So if E_3 would be red and E_1 blue we would see
I am creating a graph for data that I collected. It was pretty easy to create. The problem is that I want to be able to have certain segments a red color. This is the data that I have
I would like to create a line segment which is easy to do. But I need certain segments to be red. Such as this the line segment between 10006-10450 should be red. And the segment from 11424-11691 should be red too. I have attached my current chart that does not have the red.
I am having a hard time figuring how to change the color of all the different text groups in a chart, header, axis, labels etc, and even the macro recorder has failed me this time - I have recorded the following, where I selected the graph, changed textcolor to white and then ended the recording - but without changing anything in the code, it returns an error on the second line (starting with "with"):
Run-time error '-2147024809 (80070057)': The value is outside of the boundaries (translated from danish)
ActiveSheet.ChartObjects("Chart1").Activate With ActiveSheet.Shapes("Chart1").TextFrame2.TextRange.Font.Fill .Visible = msoTrue .ForeColor.ObjectThemeColor = msoThemeColorBackground1 .ForeColor.TintAndShade = 0 .ForeColor.Brightness = 0 .Transparency = 0 .Solid End With
From what I have read, it might be something with the textframe2 property.
I have a quarterly report that measures the safety performance of the plants in our company using bar charts. One set of 4 charts for the company as a whole and four additional sets of four for each of our divisions for a total of 20 charts.
I would like to change the color of the bars based on whether the location has met (bars colored green) or failed to meet (bars colored red) the goal for that criteria. The company average will be a yellow bar. Of course it can be done manually but that is really slow and tedious.
Is there a way, using VBA or a macro, to change the color of a bar (data point) based on the value of that data point? Can it run through all of the data points in each chart and make those changes based on criteria that I can set for each type of chart?
I am trying to create a chart that will show each month of the year's workload based on orders due for each month. I have all of the information needed on a spreadsheet to chart this into a simple chart showing the load, however, I want a little extra on the charting to show me additional details.
I would like for my chart to also display the available man hours for each month against the workload. I would like for the available man hours to be displayed by color changes in each month bar column of the graph.
So if I had 1000 hours of work in the month of April and only 960 man hours available in April it would have shown me throughout the month as the chart grew that I was "Green" for all hours below 860. The as the chart grew past 860 that portionof the chart changed to "Orange" telling me that the hours were soon to be full. Once it reached 960 that part of the chart would turn "Red" as an indication that we have more workload than we can complete for that month. This would be useful for me as an overtime tool, as well as for review for additional man hours or a decrease in man hours.
I have a column chart that goes 0-100%. The back wall is red from 0-60%, yellow from 60-80%, and green from 80-100%.
To do this, I shaded some blank cells to the same proportional shape, did a screen capture, saved that image as a file, then imported it back in as the background.
Problem is, those color breakpoints (60%,80%) may change, and that process is a pain. Is there an easier way to do this such that if I change the values the background will change automatically based on the shading of some cells?
I am trying to color code the cubes in my chart. I'd like to be able to be able to specify a specific color per cube. What code what I write for the Sheet to do this?
I have been struggling for some time to find a simple code to color index cells that have two conditions, one being the task owner and the second being the time requirement. I have a drop down list for populating each row of a gannt chart with the owner, this owner also has an associated number referencing the allocated colour index number. To the right of the owner is a basic time line with each column represneting days, weeks or whatever measurement. These columns are populated simply with an "x". What I want to do is to choose the owner, go across to the time, type in an "x" in the time slots and the cells with an "x" are coloured with the relevant owners colr index. I have researched the threads, read my text books, looked up the help and found a lot of references which are around the solution but none which nail it. Looking forward to your assistance.
I would like to display 50 sequences, S_1 ..S_50, with stacked bars. Every sequence can contain 5 different events, E_1 .. E_5, in a random order. Every event has a certain duration, t. Lets say the first two sequences are as follows (duration time is in breckets)
S_1: E_3(200), E_1(150), E_2(300), E_4(500), E_5(300) S_2: E_1(200), E_4(150), E_1(300), E_5(500), E_2(300), E_2(300) ... How do I get Excel to display all Sequences in one graph as a function of time, with the bar-stack-color displaying the kind of event. So if E_3 would be red and E_1 blue we would see S_1: red, blue ... S_2: blue, ...
I am trying to have the points and the lines connecting them on my line graph be two different colors depending on a value i put in a column next to the chart values.
For example: x y Variable 1 5 1 2 10 3 16 1 4 5
The points where there is a 1 in the variable column i would like to make a different color from the other points.
I did an extensive search and all i could find was the following:
Sub myChartClass_Calculate() Dim cht As Object Dim p As Object Dim V As Variant Dim Counter As Integer
However, this uses the values from the chart data, not an outside variable.
I have a data set that I'm trying to present in a pivot chart and am wanting to use one series to color code or weight another series in the chart. For instance, let's say I have different product categories and two metrics for each, a profit margin (expressed as a %) and a revenue figure (expressed as $s). I want the height of individual bars to represent the profit margin but have the level of opaqueness represent the revenue figures...ie the more revenue associated with a product the more opaque it becomes.