i got data in two arrays in the macro, let say a() and b()
and i want to get a bar chart of plotting a() as y-axis against b() as x-axis
i got some codes like this if i post my data in the worksheet first, but i dont know how i can do it directly ... i dont want to show all my data in the worksheet...
"Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range(_ "K1:L10"), PlotBy:=xlColumns
....."
You can base you chart on array data but you will be restricted by the length of the Series formula. ~1024 characters
You can hide the cells as long as you uncheck the option to 'Plot visible cells only'
Thanks both
but could you please explain in detail ? 'cause i don't really understand ...
@tigertiger - what is a REPT() function ? how to apply that ?
@Andy Pope - can you tell me more about how to do that ?
thanks in advance !!!
Code:With Charts.Add With .SeriesCollection.NewSeries .Name = "Test" .Values = Array(1, 2, 3) .XValues = Array("A", "B", "C") End With .ChartType = xlColumnClustered End With
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks