Help my multiple charts & series are on top of each other; would like to see all

O

osman

First of all thanks for looking. I have VBA program that reads creates
about 5 charts each with its own series. The issue now is how can I
add a code to see all 5 charts on the same sheet.

CODE:
If once = 0 Then
Range("A1").Select
Charts.Add
ActiveChart.ChartType = xlLineMarkers
once = 1
End If

If crnt_sht > 1 Then
ActiveChart.SeriesCollection.NewSeries
End If

With Worksheets(crnt_sht)
ActiveChart.SeriesCollection(crnt_sht).XValues = .Range(F1 &
":" & F2)
ActiveChart.SeriesCollection(crnt_sht).Values = .Range(F3 & ":"
& L1)
End With

ActiveChart.Location Where:=xlLocationAsObject, Name:="sheet1"


With ActiveChart
..HasTitle = True
..ChartTitle.Characters.Text = search_item_arr(srch_count) &
" ]"
..Axes(xlCategory, xlPrimary).HasTitle = False
..Axes(xlValue, xlPrimary).HasTitle = False
End With


ActiveWindow.Visible = False
Windows("under const.xls").Activate
 
G

Graham Whitehead

It may help to define the name of each chart first. Then you can set the
location and size of the chart in this way (the location is changed by the
first two of the 4 numbers, and the size by the last two).
For example:

dim chtChart as chart

with ActiveSheet
Set chtChart = .ChartObjects.Add(50, 50, 600, 300).Chart
end with
 
O

osman

Thanks Graham, I will try that..

Graham said:
It may help to define the name of each chart first. Then you can set
the
location and size of the chart in this way (the location is changed by
the
first two of the 4 numbers, and the size by the last two).
For example:

dim chtChart as chart

with ActiveSheet
Set chtChart = .ChartObjects.Add(50, 50, 600, 300).Chart
end with


osman said:
First of all thanks for looking. I have VBA program that reads creates
about 5 charts each with its own series. The issue now is how can I
add a code to see all 5 charts on the same sheet.

CODE:
If once = 0 Then
Range("A1").Select
Charts.Add
ActiveChart.ChartType = xlLineMarkers
once = 1
End If

If crnt_sht > 1 Then
ActiveChart.SeriesCollection.NewSeries
End If

With Worksheets(crnt_sht)
ActiveChart.SeriesCollection(crnt_sht).XValues = .Range(F1 &
":" & F2)
ActiveChart.SeriesCollection(crnt_sht).Values = .Range(F3 & ":"
& L1)
End With

ActiveChart.Location Where:=xlLocationAsObject, Name:="sheet1"


With ActiveChart
HasTitle = True
ChartTitle.Characters.Text = search_item_arr(srch_count) &
" ]"
Axes(xlCategory, xlPrimary).HasTitle = False
Axes(xlValue, xlPrimary).HasTitle = False
End With


ActiveWindow.Visible = False
Windows("under const.xls").Activate


--
osman
------------------------------------------------------------------------
osman's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=34226
View this thread: http://www.excelforum.com/showthread.php?threadid=564286
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top