PDA

View Full Version : Modifying the existing graph



satyampakker
06-09-2008, 08:24 AM
hi
this post is related to the post i recently posted ploting graphs according to the sheet selcted.

Thank you very much!! i solved my problem concrend with that post..
as i got a reply for that post saying that

"i tryed to get this error, on your sample workbook, but coudn't. although i did notice that you had well over 20 graphs stacked on top of each other. you might consider modifying the existing graph, rather then constently making new graphs"

I am unable to solve the stacking problem ,this problem is occurs when i open my file in other computer

how to overcome this problem??
please help me ..

i am attaching my file and pasting my code which makes the chart


Sub MakeChart()
Dim rng1 As Range, rng2 As Range
Dim gs As String

gs = ComboBox1.Value
Application.ScreenUpdating = True
'First selected
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
Set rng1 = Columns(1).Find(ListBox1.List(i))
Exit For
End If
Next
'Last selected
For i = ListBox1.ListCount - 1 To 1 Step -1
If ListBox1.Selected(i) Then
Set rng2 = Columns(1).Find(ListBox1.List(i))
Exit For
End If
Next

Charts.Add
With ActiveChart
.ChartType = xlColumnClustered
.SetSourceData Source:=Sheets(gs).Range(rng1, rng2).Offset(, 1).Resize(, 2), PlotBy _
:=xlColumns
.SeriesCollection(1).Name = "=""x"""
.SeriesCollection(2).Name = "=""Average"""
.Location Where:=xlLocationAsObject, Name:=gs
End With


Application.CommandBars("Chart").Visible = False
Range("A1").Select
Application.ScreenUpdating = True

End Sub





thanks
satyam

Bob Phillips
06-09-2008, 08:30 AM
So two threads on the same topic wasn't enough, you thought you might as well start a third?

satyampakker
06-09-2008, 08:36 AM
So two threads on the same topic wasn't enough, you thought you might as well start a third?

yep like i think this is a diffrent problem that people may face in the future ...so i posted in a diffrent thread sorry if you feel something wrong about this actually i posted only one thread earlier unfortunately isubmitted my post twice ..that was the problem.

sorry if you feel something wrong

try to help me with my question

thanks
satyam