Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to fill an array with the charts on a worksheet so that I can loop through each.
i.e chartArray = Array(Chart1, Cahart2 For each a in chartArra 'do somethin next This is ok, however I don't know the chart names and they will change from time to time So, how do I populate the array with the chartobjects names on the activesheet John |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
John
You don't need to put them into an array. Try the following For Each ch In ActiveSheet.ChartObjects MsgBox ch.Name Next ch Tony -----Original Message----- I want to fill an array with the charts on a worksheet so that I can loop through each. i.e. chartArray = Array(Chart1, Cahart2) For each a in chartArray 'do something next a This is ok, however I don't know the chart names and they will change from time to time. So, how do I populate the array with the chartobjects names on the activesheet? John . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
the chartobjects collection finctions like an array, so often you don'
need to create an array, eg: Sub show_charts() For Each CC In ActiveSheet.ChartObjects MsgBox CC.Name Next End Sub if you do need to create an array, try this: Sub create_chart_array() Dim chartarray() n = 0 For Each CC In ActiveSheet.ChartObjects ReDim Preserve chartarray(n) chartarray(n) = ActiveSheet.ChartObjects(n + 1).Name n = 1 + n Next End Su -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Array to Populate ListBox Problem | Excel Discussion (Misc queries) | |||
Populate an array that is a subset of a larger array? | Excel Worksheet Functions | |||
How do I Auto Populate a cell with a chart based on a value | Excel Worksheet Functions | |||
Need to randomly populate a 10x10 array of cells with 100 names - 5 people listed 20 times each... | Excel Programming | |||
Populate array | Excel Programming |