For Each Sht In Sheets Bombs On Chart
Dec 27, 2006
I created a chart with F11. It becomes the first, well, "sheet" in the workbook, Chart1. It's active when I go
Function foo()
Dim wksht As Worksheet
For Each wksht In Sheets
Boom. Now what do I do? I can't just go activesheet.next.select in error trapping code - can I??!!
View 9 Replies
ADVERTISEMENT
Jun 1, 2009
I've developed a workbook with macros in Excel 2007 (Compatibility
Mode), Windows Vista Operating System. The purpose of the Macos
is to allow auto complete on a validated data entry field.
The macros run fine on this platform. I then copied the workbook
to my desktop, Excel 2000, Windows 2000 Professional Operating
System. One of the macros is killing Excel on this platform.
View 14 Replies
View Related
Mar 30, 2008
I have received following macro from someone to delete series but the problem is that it gives error when some sheets are protected, and I want those sheets to protected. When run it will ignore/leave protected sheets but delete series only from unprotected sheets
Private Sub CommandButton1_Click()
Dim Rng As Range, i As Long, r As Range, lVal, uVal
Dim DeleteCount As Double
Dim lRow As Long
Dim dr As Long
Dim dc As Long
dc = Sheets("Deleted Numbers").UsedRange.Columns.Count - 1
dr = Cells(Rows.Count, Sheets("Deleted Numbers").UsedRange.Columns.Count - 1).End(xlUp).Row + 1
If dr = 60001 Then ................
View 4 Replies
View Related
Oct 22, 2013
I have a sheet open that I would like to have a chart like...umm...floating in front of?
First off I want the same "chart" (or block of cells) to be on all sheets of my file so if I enter information into it on one of the sheets it'll be the same on all of them. That's the most important part.
The other thing I'm looking to do with it is I would love for it to remain stationary when I scroll up and down on the sheets. So basically the left half of my screen would scroll up and down but the chart on the right would stay put in my line of vision no matter how far down I scroll.
View 9 Replies
View Related
Aug 8, 2007
I'm currently working on a workbook that has over 50 different sheets. On each sheet there is a column K that I want to graph if desired. From the Main sheet I would like to have checkboxes or something, so that when I press on it, the data from sheet x is added in the graph. Can this be easily done? It's not a problem to hardcode the which-button-calls to-which-sheet (just takes some time), the main thing I cant work out, is how to add a series to a chart, how do delete a series from a chart and so on..
View 9 Replies
View Related
Jan 5, 2008
Sub Macro1()
Sheets("AllSheets").Select
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("sheet2").Rows("48:48")
ActiveChart.Location Where:=xlLocationAsObject, Name:="sheet2"
ActiveSheet.Shapes("Chart 7").ScaleWidth 1.79, msoFalse, _
msoScaleFromBottomRight
ActiveSheet.Shapes("Chart 7").ScaleHeight 1.01, msoFalse, msoScaleFromTopLeft
ActiveSheet.Shapes("Chart 7").ScaleWidth 1.09, msoFalse, msoScaleFromTopLeft
ActiveSheet.Shapes("Chart 7").ScaleHeight 1.01, msoFalse, msoScaleFromTopLeft
End Sub
i need the chart to be inside allsheets. currently it create a new sheets chart1 once i generate it.
View 9 Replies
View Related
Jul 19, 2008
I would like to hide all worksheets and chartsheets in a workbook. I use
For Each sh In Sheets
sh.Visible = xlSheetVisible
Next sh
but I think it breaks down for chart sheets. Any solutions?
View 9 Replies
View Related
Jun 30, 2006
I’m would like to delete some sheets in my workbook using a macro. The problem is that
I won’t know in advance the name of these sheets.
I was thinking using a code like the following one to delete the sheets but the problem is that Excel expect a sheet name at this part of the code since it is expecting the sheet name.
Sub Delete_Active_Diagram()
Application.DisplayAlerts = False
Dim i As Integer
Dim strSheetName As String
Dim blnFound As Boolean
strSheetName = "Average Sales Per Week" & "" & Sheets(i + 1).Range("C3")
i = Sheets.Count
For j = 1 To i
If Sheets(j).Name = strSheetName Then
blnFound = True
Exit For
End If
Next
If blnFound = False Then Exit Sub
If blnFound = True Then strSheetName.Delete
End Sub
Is there a way to cope this problem, or should i think about another way to do it. Like selecting each sheet I would like to delete and then delete the selected sheets.
By the way. All the sheets I try to delete a Charts Sheets. Maybe there is a way to delete all the charts in my workbook.
View 5 Replies
View Related
Mar 22, 2009
I want to do is be able to take The data from one week for every store and compile it into a chart to show a summary of the company as a whole. I know that I can reference from that chart to each worksheet the values I want, but how would I give that chart the ability to update each time I add a weeks worth of data.
I have attached a file that shows what I am talking about. The sheets labeled Waterloo, Mogadore, through Green are the sheets for each store.
I want to take the last weeks data and put it into a chart as seen on Sheet1. Then when I add data for 3/21/09 I want to make a new chart without retyping the data into the chart.
View 2 Replies
View Related
Jun 3, 2006
I have a two-parter...
1) Is it possible to write a macro that will resize fonts in a chart (axes, text boxes) to specific sizes?
2) I usually copy chart sheets and paste them into Publisher but I have to resize them because they are huge when pasted. I would like to create a toolbar command that will take the selected chart sheet (not just a chart in a worksheet) and resize it and its components (part 1) to specific dimensions, then copy it as a picture so that I can simply go to Publisher and paste the chart after pressing said button in Excel.
View 9 Replies
View Related
Jan 3, 2009
I want my charts to be located in a new sheet each. I also need their names to start with "GR-Chart[number here]". So they should be GR-Chart1, GR-Chart2, GR-Chart3,......
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:= "GR-Chart" & [this part I got wrong]
Do I use i? or .Count?
View 9 Replies
View Related
Apr 9, 2014
I have multiple sheets from 'START' to 'END' as you can see below, the name of the sheets are dates.
I want all sheets to be listed in the 'INDEX' sheet. Every time I add a new sheet between 'START' and 'END' i want the new sheet to be listed.
I want to use the value from cell C5 in each sheet to my Line Chart on the 'INDEX' sheet.
In the X-axis in the Line Chart i want to use the dates.
View 1 Replies
View Related
May 10, 2008
I am using Reafidy nice bit of code to hide worksheets if the user disables macros. The problem, though, is that it doesn't work for Chart Worksheets. How should I adjust this to accommodate charts?
Private Sub Workbook_BeforeClose(Cancel As Boolean)
bIsClosing = True
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim wsArray() As Variant
Dim iCnt As Integer
Application. ScreenUpdating = 0
Splash.Visible = True
View 4 Replies
View Related
May 20, 2013
I need drop-down combo box to change a graph based on the option selected in the drop-down
Challenge: my Combo box resides on the First sheet only, but the items that populate in the drop-down list are dynamic and change depending on how many sheets exist for this document. The options in the list are Overall, Week 1, Week 2, ... Week N. Overall needs to sum up the data (or I can pull just from the summary page if I am lazy) and the Week N corresponds to a specific sheet added.
I currently am able to get my drop down to populate items correctly, and my macros to create the sheets dynamically with templates just fine (not bad for newbie).
So what I need to figure out is how to tie my drop down to make a scatter plot/bar graph based on the selected option and action. I can't find an attachment option here but here is some code:
Sheet 1 Code:
Code:
Private Sub Worksheet_Activate()
Me.ComboBox1.Clear
Me.ComboBox1.AddItem "Overall"
[Code].....
View 2 Replies
View Related
Jul 12, 2013
How do I paste the first chart into the second chart but maintain the format of the second chart?
View 2 Replies
View Related
Jan 14, 2014
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.
View 5 Replies
View Related
Feb 24, 2007
I 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.
View 7 Replies
View Related
Nov 27, 2011
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.
View 1 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
Jul 14, 2012
I have created a population pyramid and want to add another chart on the secondary axis which I can do. The part which I seem not to be able to complete is getting the line chart secondary axis to read from the primary y axis. It seems to add a new axis, even when I delete this the line chart does not read correctly.
View 1 Replies
View Related
Apr 18, 2013
How can I add missing values to the axis in a pivot chart line chart? I have a numerical X-axis with values such as 0,1,5,8,14, etc. I have another set of Y values that correspond to the X values. If this was an XY-scatter plot I'd be able to plot X vs. Y and connect the dots for "gaps" in the X values. Since it's a pivot chart I cannot use an XY-scatter plot, I can only use a line chart. The line chart doesn't give me the ability to add the "missing" values, so it gives the impression that my data is more closely packed than it is. The data source is external to my spreadsheet, so I cannot add the values before creating the pivot table/chart.
View 1 Replies
View Related
Mar 26, 2009
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 4 Replies
View Related
Jun 30, 2009
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 2 Replies
View Related
Feb 15, 2012
I am trying to overlay a line chart on top of a stacked column chart. The stacked column chart is a chart where the x axis is dates and the y axis is amount. The line chart is a projected amount that I will reach in few years; the x axis is the date while the y axis is an amount. I can get a chart that has a line and stacked columns, but ever time, the dates get messed up. The line has an extremely wide date range while the columns only have about a month of data.
View 9 Replies
View Related
Jan 22, 2008
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 13 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
Sep 15, 2014
In the attached file I have the data which shows me the market size in value, my market share in value & I did a calculation to get the percentage. What I need is a chart that shows me the market size in column graph, my market share in line graph and I want the percentages to be showing also.
View 3 Replies
View Related
Dec 17, 2013
I have created a pie chart showing top 10 best selling categories. However, on this pie chart, I want %age of overall sales to be shown.
At the moment say I put in the following
Catalogue 1 100
Catalogue 2 98
Catalogue 3 92
Catalogue 4 85
Catalogue 5 84
Catalogue 6 75
[Code]....
I add Data Labels and select the percentages. This shows at Cat 1 having 12.5% of the sales (100 of 800 sales), Cat 2 having 12.25%, and so on..... However, what you don't see is the following data:
Catalogue 11 60
Catalogue 12 58
Catalogue 13 57
Catalogue 14 57
Catalogue 15 56
So based on 1,088 sales, Cat 1 at 100 is actually only 9.19% of TOTAL sales.
I understand what is happening, the chart is giving the percentage based on the data inputted into the chart.
I did consider adding an 11th category to the chart, which was the total of Catalogues 11-15. Whilst this does give a more accurate percentage figure (as now all sales have been inputted), it makes the chart look ****
Is there a way of either adding the 11th category, and then "hiding" it, so that the chart doesn't display it, but uses it's value to calculate Catalogues 1-10s percentage?
BTW: The reason I ask is that I could be dealing with anywhere from 30 to over 100 catalogues. So it's not ideal showing the others in 1 chart.
View 1 Replies
View Related
Nov 28, 2008
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 7 Replies
View Related
Jun 28, 2009
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 2 Replies
View Related