How to Handle Chart Sheets

i have a code where it populates all the sheet name  in  a combo
box .. but i get an error when any workbook has chartsheets. i need to
modify this code snippet in such a way that it has to populate even
chart sheets object name  in a combo box if not atleast igonore chart
sheets object name ......

For Each wks In ActiveWorkbook.Sheets
       If wks.Visible = xlSheetVisible Then
                ctrl.AddItem wks.name
        End If
Next wks
0
vicky
1/6/2010 2:46:51 PM
excel.programming 6508 articles. 2 followers. Follow

2 Replies
621 Views

Similar Articles

[PageSpeed] 29

By Declaring Wks as Object I can certainly avoid error but chartseet
name are not populated in combooo box .
0
vicky
1/6/2010 3:30:26 PM
Hi,

For just worksheets use,

dim wks as Worksheet

For Each wks In ActiveWorkbook.Worksheets
     If wks.Visible = xlSheetVisible Then
         ctrl.AddItem wks.name
     End If
Next wks

Cheers
Andy

vicky wrote:
> i have a code where it populates all the sheet name  in  a combo
> box .. but i get an error when any workbook has chartsheets. i need to
> modify this code snippet in such a way that it has to populate even
> chart sheets object name  in a combo box if not atleast igonore chart
> sheets object name ......
> 
> For Each wks In ActiveWorkbook.Sheets
>        If wks.Visible = xlSheetVisible Then
>                 ctrl.AddItem wks.name
>         End If
> Next wks

-- 

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
0
Andy
1/6/2010 3:48:10 PM
Reply:

Similar Artilces:

Gantt Chart and Critical Path
I have a spreadsheet where I enter time line data in the cells and from that information generate a Gantt chart. What I would like is a way to have symbols on my chart to show milestones, and end points. Anybody have any ideas as to how I could add those symbols on a chart? Thanks. Royce - That's a page I haven't added to my web site yet. Your gantt chart is a stacked (or floating) bar chart. To add symbols, you need to add additional series, using time as your X values, and a normalized Y value corresponding to the bar that needs the marker. Use 1 for your topmost bar, and N...

soften jagged edges of pie charts
I am trying to smooth the angles in pie chart which prints okay from an excel but not when I copy and paste it on a microsoft word document Instructions said go to format, click selected data series and click patterns tab then select smoothed line. But the box Smoothed line doesn't exist. Have you tried copying as picture (Shift-Edit-copy as picture)? "zen" wrote: > I am trying to smooth the angles in pie chart which prints okay from an excel > but not when I copy and paste it on a microsoft word document > > Instructions said go to format, click selected...

Excel should default to autoformat for chart text boxes
Excel in (Office 2003 and as far as I can tell all previous versions of Excel) should default to autoformat for chart text boxes - it currently selects "none" for outline and background options ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.micr...

How do I add a secondary axis to a pivot table chart?
Using XL2007 - the secondary axis radio buttons are greyed out. Is there a way to add the 2nd axis? Hi, This is chart type dependent. Suppose you have a line chart, right click the series and choose Format Series, the Axis radio button should be available. What type of chart are you using? Cheers, Shane Devenshire "dangelor" <dangelor@discussions.microsoft.com> wrote in message news:2610028F-5FAF-4400-A3E3-B7D0CCEFB443@microsoft.com... > Using XL2007 - the secondary axis radio buttons are greyed out. Is there a > way to add the 2nd axis? ...

Sheet to close
Why won't this work? oldjayo Sub test() Dim wsShtToSave As Worksheet Set wsShtToSave = ActiveSheet If wsShtToSave= "Master" Then ActiveWorkbook.Save ActiveWorkbook.Close End If End Sub Activesheet.name= try this simpler version Sub CloseifMaster() If ActiveSheet.Name = "Master" Then With ActiveWorkbook 'one dot only .Save .Close End With End If End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "oldjay" <oldjay@discussions.microsoft.com> wrote in message news:...

How to make Unique coloumn in Excel sheet ?
I want to make one coloumn in excel sheet as unique, so no entry is repeated in that particular column. See http://www.contextures.com/xlDataVal07.html on this. HTH. Best wishes Harald "V JHANJI" <V JHANJI@discussions.microsoft.com> skrev i melding news:5D9465E8-EE69-4D59-8BD7-B0115D09145C@microsoft.com... > I want to make one coloumn in excel sheet as unique, so no entry is repeated > in that particular column. Hi check out http://www.cpearson.com/excel/NoDupEntry.htm for detailed instructions on how to do this. Cheers JulieD "V JHANJI" <V JHANJI...

Delete embedded chart, how?
I have 2, (Gnatt), charts on the wrksht. How do I del one? -- Boswell Select the chart, hit the delete button. -- David Biddulph "Boswell" <boswell6@sbcglobal.net> wrote in message news:C439A52B-E430-4B40-95DB-1563E22939AF@microsoft.com... >I have 2, (Gnatt), charts on the wrksht. How do I del one? > -- > Boswell ...

Pie Chart color
Hi, Excel 2003. I have a 3 series pie-chart, I simply want to change the color of ONE of the 3 slices in the way I want. Thanks for help. Click the slice; pause; click the slice again, it should now have 'handles' around it. Use Format | Data POINT in menu (if it say Data SERIES, try again) best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "Freightliner" <freightliner2006@hotmail.com> wrote in message news:87a8c3a5-2d6e-43d2-a0ec-7aa1b25c1296@8g2000hse.googlegroups.com... > Hi, > > Excel 2003. I...

Detailed Time Sheet (overtime, comp time, vacation used)
I need to track in time, out time, in time, out time, overtime, vacation totals (received/used), comp received, comp used, and so. I would recommend to write all the headers on row 1, and start entering the data on row 2. Any column that is a calculation, enter a formula (for example, if column E is the difference of column D and C, enter "=D2-C2") and format the cells as you want the data to be presented (date/time, number, etc.) Hope this helps, Miguel. "Robert D. Sandersfeld" wrote: > I need to track in time, out time, in time, out time, overtime, vacation ...

create price list from excel sheet
I have been using Excel 2003 to manage a list of approximately 200 items. This is a very simple list comprising of four or five fields one of which is the price. I prefer to use Excel to manage this data because it then becomes very simple for me to use formulas in order to calculate prices after changes or additions to the items. I would like to produce a simple A5 flyer listing all the items together with their prices. What will be the best way to do this? I have explored the possibility of exporting the Excel sheet into something like Microsoft publisher but I am looking for a fa...

Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook?
Wow! I tried this out, and it seems to work beautifully. It's odd, though, that I haven't seen this technique mentioned in any of the several Excel references that I've looked at. Basically, I have a workbook with several worksheets...one worksheet contains a large list with all the records. I wanted to set up the other worksheets to have certain functions...I wanted them to use only certain columns from the main list, and to contain only certain records from the main list that met specified conditions. This is the best solution I have found so far - i.e., creating database q...

move axes and axis labels behind data points on scatter chart
I'm working with a series of XY scatter charts that all pull data from the same worksheet. They are all copied from the "original" scatter chart and then just have the cell references changed so that the formatting stays consistent across the series. (The charts will be shown sequentially and I don't want anything changing other than the location of the data points.) However, on some of the charts, the axis and/ or the axis label appers on top/ in front of some of the data points and behind/ under other data points (which is what I want - the axes and labels behind th...

Formatting Chart Category Labels
I'm creating a fairly complex chart - a spider graph "dashboard" report that addresses 4 major areas of an organization's performance - finance, quality, efficiency and customer satisfaction. Each category has 4-7 data elements, so that there are a total of 22 data elements on the chart. There will be 2 sections of the report, a chart showing YTD, LYTD and Goal values for the data elements and the graph itself. I envision this as a relatively easy way for management or board to get a snapshot of comparative key performance indicators. So far so good - input form, c...

Charting Problem #2
I have a problem with charting a Dynamic chart. I goes ok to set up the dynamic function as a range. It also shows the correct series. The range is as follows: =OFFSET(Sheet3!$A$1;1;Sheet3!$P$2-1;COUNTA(INDIRECT("C"&Sheet3!$P$2;FALSE));1) Where P2 is an input from a listbox, and the name of the range is: Sheet3!Dato. When I try to change the reference for the series i get the following message: "Your formula contains an invalid external reference to a worksheet. Verify the path, workbook, and range name or cell reference are correct, and try again." The serie...

Which 'event' to run pivot chart formatting code on file open?
Greetings I have code to change my pivot chart type to a mix of line and column also to refomat colours I need to run the code so that the user sees the changes when the file is opened Ive tried the 'workbook open' event and the chart activate event but noy joy so far. (Once the file is open, manualy triggering the code works perfectly) Any ideas? Thanks I don't know why workbook_open doesn't work. You could use Application.OnTime to run your code a short time (like 2 sec) after the workbook opens. - Jon ------- Jon Peltier, Peltier Technical Services, Inc. http://Peltier...

How to type subscript and superscript in excel sheet
Hi Can anybody suggest me how to type the subscript and superscript in excel sheet?????????????????? Hi select the characters in the formula bar and goto 'Format - Cells' "Desh" wrote: > Hi > Can anybody suggest me how to type the subscript and superscript in excel > sheet?????????????????? > IF you do this a lot, John Walkenbach's free SuperSub add-in makes it much easier (it's included in his commercial PUP v5 add-in, as well): http://j-walk.com/ss/excel/files/supersub.htm In article <E060E171-0622-4DB1-8734-3B4727A3FF4E@microsoft.com&...

Adding a horizontal line to a Pivot Chart
I can't get a horizontal line added to a pivot chart (column or line) by using the series method. Can anyone help me out? I'm trying to add the horizontal line to show things like the mean and standard deviation. Thanks in advance. Sharon - Pivot charts don't allow you to include data that's not in the pivot table, and I think it only allows a very limited number of combination charts, if any. Sorry to disappoint. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services http://PeltierTech.com/Excel/Charts/ _______ sharonc wrote: > I can't get ...

Autoscale a Line Chart to stack the curves
hello! To compare financial market assets moves I use a single chart with 2 series. The chart has 2 vertical axes and the scales are pretty different in term of values. The autoscale works fine on both axes. My queston is: How do I translate a curve onto the other so that they get "stacked", to be easily compared at a glance ? Any VBA function or sub is welcome... Thx This post might help. It shows how to calculate a proportional axis on a dual-axis chart. The effect is to plot the movement of one series against another to see how well they are correlated. Because each...

Chart Legend Items: hide/show
How do I hide/show a series on a chart legend (scatter plot.) I tried a null string (""), but the trace still shows. I also tried #N/A. But it then shows "#N/A"; the same with function: NA(). What I am trying to do is to have a control button to show or hide a series from the chart. I can set all the series values to #N/A which hides it, but I am having trouble trying to hide the legend for the series. I also tried an "if" function in the chart->series dialog, but It evidently will only accept a cell pointer. "Jon Peltier" <jonREMOVExlmvp@p...

Excel 2007 Bar and Line chart on 2 Axes
I used Excel 2003 to create a "bar and line chart on 2 axes" and now have 2007. I can't find where or how to create these charts using Excel 2007. Can someone tell me how to do it? Start here http://office.microsoft.com/en-us/excel/HA102004991033.aspx Then Google "Excel 2007 chart"; look at a few sites Then come back here with specific questions and we will help you get it right. best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "Nancy" <Nancy@discussions.microsoft.com> wrote in message...

How do you do set up a hierarchy chart in PP 7
I'm trying to set up a hierarchy chart in PP7 but the template presented doesn't allow me to add boxes below with a direct line. Sometimes I get a slanted line and I can't delete it. ...

Lock sheets automatically
Hi everyone, I have 26 fortnightly timesheets in a workbook for every staff and would like to lock each timesheet after some days.Can you please help me to fix my code as the follows: Select Case s_worksheet Case "TS1", "TS2", "TS3" If (DateDiff("d", B12, Date) > 6) Then s_worksheet.Unprotect "admin" s_worksheet.Range("C6:C12,D6:D12,F6:F12,G6:G10,H6:H10,I6:I10").Locked = True s_worksheet.Protect "admin" End If Case Else: End End Select Man...

split bar chart
I need to create a bar chart using the following data: Column1 = 2 (value inside cell) Column2 = 3 (value inside cell) Coumn3 = 5 (=column1 + column2) Here's the layout I'm looking for: bar1 would start at 0(zero) and stop at 2 bar2 would start at 3 and stop at 5 (nothing would show below 3 for this bar) It's pretty much a stacked bar graph but each "stack" would be in its own column. Thanks! Not sure if it is what you need but goto www.stfx.ca/people/bliengme/ExcelTips and look at Column Chart with a Difference best wishes -- Bernard V Liengme www.stfx.ca/p...

Broken lines in a chart to display extreme values?
Sometimes a single extreme value causes the rest of the data to become too small, like a bar chart of the values (10000, 4, 3, 2, 4, 5). The way to avoid is to use broken lines where the axis makes a leap from 10 to 9990 with a dotted gap inbetween. I couldn't find a way to implement this in Excel. Is there a way? Hi, It is not a built in option but can be constructed. http://www.andypope.info/charts/brokencolumn.htm Cheers Andy Metin Örsel wrote: > Sometimes a single extreme value causes the rest of the data to become too > small, like a bar chart of the values (10000,...

Chart Data Source
Hi, Thanks in advance. How do I get the data source of a chart and put it in a varable with VBA code? Thanks Trev B -- Trev B Excel 2007 Chart VBA Get source range from chart. http://www.mediafire.com/file/mozmw2mmnrk/12_16_09.xlsm ...