Changing Chart Location
Sub autograph()
Dim x As Long, t As Long, y As Long, z As Long
y = 3
z = 5
x = 4
While x < 609
With Worksheets("cabernet (2)")
t = Cells(x, 1).Value
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("cabernet (2)").Range("B" & y & ":H" & z), PlotBy:=xlRows
ActiveChart.Location where:=xlLocationAsObject, Name:="Cabernet (2)"
ActiveWindow.Visible = False
ActiveChart.HasTitle = True
ActiveChart.charttitle.Text = " " & t
Windows("complete Favorite Genes.xls").Activate
y = y + 3
z = z + 3
x = x + 3
End With
Wend
End Sub
This time, however, instead of having a slight idea of what I need to do, I don't have the slightest of where to start. I need to move all of these charts into another sheet, sheet1, and i'd like to offset them or do something so that they aren't all right on top of each other. I'd be more specific but I don't really know exactly what you can or can't do.
View Complete Thread with Replies
Sponsored Links:
Related Forum Messages:
Amending Chart Location And Size
I have craeted a chart in VBA, which sits in the middle of the page . I have attempted to move it to a new location with the following code ActiveChart.Parent. Name = "MyChart" ActiveSheet.ChartObjects("MyChart").IncrementLeft -237.75 ActiveSheet.ChartObjects("MyChart").IncrementTop 32.25 ActiveSheet.ChartObjects("MyChart").ScaleHeight 0.96, msoFalse, msoScaleFromTopLeft ActiveSheet.ChartObjects("MyChart").ScaleWidth 1.17, msoFalse, msoScaleFromTopLeft which I adapted from a recorded macro, but which fails in execution, error message indicates that the Object does not support the property or Method.
View Replies!
View Related
Source Location/Address Of Series In Graph/Chart
Looking for code that returns the cell address of a series in a pre-existing graph. I have a graph that already has Source Data manually assigned to it. Is there a way to find just the cell values or location of a single Series in a SeriesCollection object? I know that in order to assign a series of data to a Series object, you do something like this: ActiveChart.SeriesCollection(1).Values = Worksheets("My Worksheet").Range("A1:F1") The issue I am tackling with is a graph that already has preexisting data in the Series object, and I just need a quick and easy way to find the address of this data set.
View Replies!
View Related
Create Macro To Chart Data With Location As Object In Active Sheet
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
View Replies!
View Related
A Changing Range For A Chart
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 Replies!
View Related
Color Changing Column 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.
View Replies!
View Related
Pivot Chart Type Changing
I have an issue with pivot charts that I can't figure out and I can't find anyone with the same problems either. I have several big reports that use data from 2005 onwards that need to be represented on graphs separated by the city the data belongs to and different ranges of the results. This data is being sourced from inside each workbook on another tab and turned into a series of pivot tables (for each city) which provides the source for the charts. I did it like this because if I use pivot graphs I don't have to go through and individually change the data source range in the charts every time - because there are so many. My problem is that when I refresh the pivot tables (to bring in the new data) the pivot charts 'chart type' resets. They should be represented in a Line - Column on 2 Axes chart and I have set this as the defult type but after refreshing it reverts to a basic column graph and I have to go through and change them all back manually. I made a macro that acts on a currently selected chart to change the format to make this process a bit faster:
View Replies!
View Related
Changing Chart Source With Vba
I'm trying to create a chart with different source ranges e.g if i used With ch.Chart .SeriesCollection.Add _ Source:=Worksheets(1).Source:=Worksheets(1).Range("C1:C8,J1:J8") End With That works fine but I want to modify the columns it looks at. I was going to use the cells(x,y) method but I can't get it to work. icol = 3. Range(Cells(1, iCol), Cells(8, iCol)). This works for a single range(C1:C8), but how do i reference Range("C1:C8,J1:J8") in the same way.
View Replies!
View Related
Chart/Plot Changing Range
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 Replies!
View Related
Changing A Chart Source Sheet
I have a sheet ( Graphs A) with 50+ graphs on all linked to a datasheet (Data A). I now want to copy these graphs to another sheet (Graphs B) which links to a different data sheet (Data B). The data is in the same layout format etc. The problem is that the find-replace function will not replace the sheet name in the charts series formula from Data A to Data B Is there an easy way to change the source sheet for the new graphs?
View Replies!
View Related
Chart With Changing Source Data
I am trying to create a macro which will allow me to change the source data for a particular chart. what i want to do is to have a code which looks in a range of cells (A8:B28) and then updates the chart to only include those cells within the range that contain a value? The number of cells with values changes depending on what options are selected elsewhere in the spreadsheet.
View Replies!
View Related
Changing Chart Series Colours In VBA
I have a spreadsheet which reports across different categories, but there's a lot of info. So simplify this, I've written a simple macro that changes the series range in an existing chart, so top level and by category. This works well apart from I'm using excel 2007, and some people aren't, so the default colours look fine on my version, but change to some awful colours on anyone with an earlier version of excel. I need a way of changing the colours to standard ones depending on which macro is being run. I have tried running the following, but I get an error, basically saying the series hasn't been selected. ActiveSheet.ChartObjects("Chart 6").Activate ActiveChart.SeriesCollection(3).Select ActiveChart.SeriesCollection(3).Interior.Color = RGB(255, 0, 0)
View Replies!
View Related
Changing Chart Source Data Range
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 Replies!
View Related
Dynamic Chart/Graph For Changing Ranges
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 Replies!
View Related
Auto Size Dynamic Changing Chart
I have created a dynamic chart in excel where either the number of Series or the number of Data Points will change dependent on user inputs in the model. I've done this using the Offset Function in a Defined Name in Excel and dropped this Defined Name into vba code using ActiveChart.SetSourceData. Anyway, all works fine, pulling the correct data, etc. What doesn't work is the final appearence of the chart. The chart has a Legend placed at the bottom of the chart, as standard, unless there is only one Series, when I remove the legend altogether. Whilst the legend works fine, the Plot Area of the chart doesn't update automatically to accomodate the changing size / existence of the Legend. Does anybody know how to do this? I tried using hieght, etc properties, but I don't know how to make them variable
View Replies!
View Related
Interpolation Given A Variable Table Location & Location Of Data Within
I am trying to develop a spreadsheet that will calculate a cost based on a matrix. I am attaching a sample of the calculation created so far. The end result is in cell M13 and is highlighted in yellow. I kind of layed the formula out in a few different cells, so hopefully it would be easy to follow. simplify this process with maybe another formula that I might not be aware of, or maybe show me how to get this done in VB code. I think VB code would be the correct way to go just not sure.
View Replies!
View Related
Changing Chart Source Data Based On Running Date
I currently have a simply bar chart that is based on a running 5 days figure so the X-axis is like 01-Mar 02-Mar 03-Mar ... Y-Axis is the data that I am trying to present - Total $ The source of this data is simply two columns - Column A is the running date, Column B will be data. Daily I need to only present 5 days historical data based on the latest date i.e. today and the past four days (the source data is updated daily). Can a macro be used to auto update the bar charts based on today's date?
View Replies!
View Related
Changing Cell Color Based On Changing Values
This may have been answered on here but can not seem to find it. My situation is I have values in A1,A2 & A3 that are like counter reading so the value is always changing. What I am looking to do is change the cell color if one of the values is over 500 from the other two values. Say A1 is 3000, A2 is 3250 and A3 is 3500. I would like the cell for A3 to change color.
View Replies!
View Related
Stop Procedure Window Changing When Changing Sheets
Moving between different sheets changes the procedure window, which is a good thing, but can also can be error prone and annoying to search through several windows searching for the procedure or module currently working on. Is there a setting somewhere to prevent VBE from changing the current procedure window?
View Replies!
View Related
Odd Chart: Combine Data From Multiple Worksheets And Make A Chart
I am trying to combine data from multiple worksheets and make a chart. I have about 200 keywords in every worksheet (about 50), and some of them repeat themselves through worksheets and some don't. For every keyword, I have an associated value in the next column that I want to portray over time (each worksheet is for a different period). So what I need to figure out is how to be able to pick any 10 keywords from the worksheets and put them in a line chart where I can see the associated value for each period for every worksheet so I can compare my keywords' efficiency. The tricky part is that some worksheets do not contain the keyword and other worksheets contain the keyword in a different cell than the previous wsheet.
View Replies!
View Related
Combine (Overlay) Bubble Chart & Point Scatter Chart
I would like combine (overlay) a bubble chart with a connected point scatter chart. I understand that, without VBA, this is not possible. However, I understand that, by using VBA, the markers of a scatter chart can be configured as circles with their size proportional to values in a specified column. This pseudo-bubble chart can then easily be combined with a connected point scatter chart. My question is: does anyone have any VBA code to share that shows how to configure a scatter chart as the type of pseudo-bubble chart described above.
View Replies!
View Related
Line Chart - 12 Month Chart Moving With Dates
Is there a way to display only the current month and the past 11 months in a Line Chart in Excel? So if I was to print Jan 2008 Excel graph, it would only display Feb 2007 - Jan 2008 data charting. The spreadsheet of the data contains data for Jan 2005 - Jan 2008 so far, but only the current month with the past 11 months should display in the line chart depending on what is the current month.
View Replies!
View Related
Pareto Chart, Set Line Chart Origin At Zero
I have a pareto chart(Bar & Cumulative Line Chart) that I would like to have the line orginate at x = 0 & y = 0 without changing the position of the other points on the line chart. Basically this is for better visual appearance. When I add a 0 to the table, it skews the alignment of the line chart with the corresponding bar chart.
View Replies!
View Related
Chart Making- Chart With 3 Data Series
I have a chart with 3 data series. The series are located in columns A, B and C respectively. Series I is a general number anywhere from 0 to 100,000. Series 2 is also a number, but is is devided by series 1. So, if series 1 was 100,000 then series two would be 25,000/100,000 which is 0.25. Series three will always be numerator of series 2 or 25,000 in this example. The numerator, or the 25,000 will never change, so, in my example, series three will be a straight line across the chart because it is always 25,000. In my example, the .25 is plotted on the left value axes, and series one is plotted on the right value acccess (secondary axis). Series three is just a line in the middle. My problem is that sometimes the line, series 3, doesn't match the values in both the right and left values axes. So, if series one is 48,000, then series two would be 48,000/48,000 = 1, and series three would be 48000 - the straight line. The third series should be a line touching the 48,000 on the right and the number 1 on the left. It does touch the 48000 on the left, but is below the number 1 on the left.
View Replies!
View Related
Convert Scatter Chart To Bubble Chart
I would like to combine / overlay a bubble chart and scatter chart with straight connectors. I understand that, without VBA, it is not possible to combine a bubble chart with a scatter chart. Unfortunately, I am a VBA newbie, and so I cannot write my own code (though I can usually adapt code to my specific environment). My question is: does anyone have VBA code to share that will convert a scatter chart series (x,y data in 2 columns) to a bubble-style chart (bubble radius in 3rd column)?
View Replies!
View Related
Line Chart To XY Chart And Vice-Versa
Attached is the sample data worksheet. Chart 1 is XY type chart using Seconds (2nd column of sample sheet as x-axis from 42510 to 42530). How do I change it to Line chart using Time (1st column of sample sheet as the X-axis) retaining same data from 42510 to 42530 on both primary and secondary axis?. And how do I again change it back to XY chart?
View Replies!
View Related
Bar Chart And Overlaying Scatter Chart
I'll attempt to explain what I'm hoping to do. I have a column of data that I want to plot out into a chart. For example the data points might run from -1.50 to 2.5. Let's say there are 20 data points in the column and they are spaced thruout the range shown above. They tend to cluster amoung themselves into 2 or 3 distict groups. I want to first produce one horizontal bar that runs from the -1.50 to 2.5 overall range and secondly, I want to overlay a scatter chart horizontally over the bar showing where the data points lie within the range and also so I can visually see the clusters of points. With the data residing in a column, when I generate the scatter chart, the points are laying verticle within the chart and spreadout horizontally. I can manually get what I want by narrowing the chart down to the point that the points lie on a straight vertical line, but I haven't been able to figure out how to "rotate" the chart 90 deg to overlay the scatter points within the bar chart. Naturally, the optimum solution would be such that I could generate the charts originally and then allow the spreadsheet to generate the new charts as we modify the data values, etc.
View Replies!
View Related
Change Chart Series Pasted From Another Chart
I want to use a macro to change attributes of a series in a chart. Unbelievably, if the series has been pasted into the chart from another chart, and although the macro can address the series and even return values (eg name) correctly, the selection simply cycles to one of the original series on the chart.
View Replies!
View Related
Return To Last Location
How do I write a VB Script to take the user back to where they came from. Example: User is on Sheet 1 and clicks a macro that takes him to Sheet 10. I need a macro that is on Sheet 10 that takes the user back to Sheet 1. BUT if the User is on Sheet 5 and clicks on a macro that take him to Sheet 10 I need that same macro on Sheet 10 to take him back to Sheet 5.
View Replies!
View Related
Defined The Location
If Worksheets(FirstSheet).Cells(Counter, ColtoMove) = MoveIf Then 'i didn't add the THEN PORTION becasue it errors at the above statement. the problem is that when i go to the defined location (Worksheets(FirstSheet).Cells(Counter, ColtoMove)) it shows the correct/or same PO number as when i put the cursor over the "MoveIF"....this leads me to think that it should not error. Could it be a correct statement to say how the MoveIf is defined? I have added a list of all of the potential values that can cycle through this statement. how these entries could cause a problem in the above code? I am trying to keep it simple (outside of the long list below that is) PO Number 3840 4247 4260 17467 21012 38125 90495 132284 133291 133453 133840 135496 135816 4500016105 0026974 0027060................
View Replies!
View Related
A Chart Will Columns And A Line Chart Below??
I can create a column chart in excel comparing sales in 06 v's 07 for each month in 07, what I'm aiming to show on the chart is how sales have grown or not over a comparative period. A simple enough graph, I end up with about 24 columns (2 for each month and then a gap between each month). I now want a line chart to show the performance of an index over the same time period, lets say the FTSE100. I don't know how to get the line chart under the columns on the same graph, using the same x-axis with a small y-axis to the left. I could propably figure out the y-axis bit if I could only get the line chart below the columns.
View Replies!
View Related
Convert Chart Into Pivot Chart
Please look at the sample workbook below. The chart you see below is fine BUT I would like in a pivot table chart, so I could select any days on the pivot chart. I have tried it to do it myself but for some reason the time is not displaying on the pivot chart correctly. Any help please ? P.S. If not possible then can we add a scroll bar or something?
View Replies!
View Related
Pivot Chart Changes Chart Upon Refresh
I have created a pivot table and chart. The pivot chart consists of three sets of data from the pivot table. Two of the data sets are lines and the third data set is displayed as columns. I made the third data set into columns by right clicking on the data series line and selecting chart type. I change the chart type for that data set to a column and it worked great. The only problem is that when data is refreshed in the associated pivot table, the entire chart turns into columns with completely different formatting. Does anyone know how I can maintain the graph with the two lines and one column data set when I refresh the data?
View Replies!
View Related
Saving In Wrong Location
I have the following code which saves my worksheet with a name extracted from particular cells: Public Sub SaveAsMaximoWO() ThisFile = Range("AC5").Value ThisFile2 = Range("E3").Value saveName = ThisFile & " - " & ThisFile2 ActiveWorkbook.SaveAs Filename:=saveName End Sub This (for reasons I don't understand) saves the file to My Documents by default. What I would like it to do is save to another folder within my documents as default.
View Replies!
View Related
Change The Folder Location
which part of this macro I need to edit to make it open a folder I want? Sub OpenFolderRequest() YesNo = MsgBox("Would you like to open the folder to see" _ & vbCr & "which files are currently there?", vbYesNo + vbQuestion, "Open Folder?") Select Case YesNo Case vbYes myval = Shell("c:winntexplorer.exe c:winnt", 1) Case vbNo End Select End Sub I have tried changing the (c:winntexplorer.exe c:winnt) to the location name of the folder I want to open (S:Stock ControlSTOCK CONTROLOrder Confirmation)but it doesn’t seem to work.
View Replies!
View Related
Copy A Picture From On Location To Another On The Same HD
First of all, I would like to thank all Excel Forum Moderators and Members especially Andy Pope for the great effort they exert to help all members. Lately, I viewed the thread available on the following link and I admired the great perfect work and codes provided by Andy Pope so much, http://www.excelforum.com/excel-prog...-userform.html My request is similar to the points discussed in the above mentioned thread, but, it is a little bit different .. Instead of inserting the picture to the worksheet, I want the picture to be copied from one folder on the HD to another folder called (Employees photos), which is located in workbook's path. In other words, I need a code to copy one jpg picture from one location to another.
View Replies!
View Related
Default File Location
I have had my server removed that I had my default file location, when I go in to change any of my options the first thing it does is go look for this file location and brings back an error stating it cannot find the server. I cannot find anywhere else that I could change it.
View Replies!
View Related
Formulas In A Central Location
Is it possible to have the formula written in one remote cell, so that any modification done in this formula is reflected on all places where its refereced to? z26 : Formula A A1 : Formula A A2 : Formula A A5 : Formula A A6 : Formula A A7 : Formula A A9 : Formula A A11 : Formula A in this example i store the formula in z26 and variety of cells in A are using it (not all of them)Suppose if i change anything in z26. I want it reflected in all the cells that are using this formula?
View Replies!
View Related
How To Get The Original Location Of A Data
I have a range b2:g37 filled with numbers. I use max function to get the max number in this range in cell C41. For example, the number is 20400. Now I want to know where the 20400 is originally located in the spreadsheet (ie. in column B, C, D, ...? in row 2, 3, 4, ...?).
View Replies!
View Related
|