Hi there ,
I try to change the top position when adding a chartobject in a specific sheet.
My purpose is to add several charts with their specific datarange , but each chart should be placed in a different region on the specific sheet.
Therefor i put new values in the top , width , height and left position like :
TPos = TPos + 250
WPos = 385
HPos = 255
LPos = LPos + 390
I use the following code to add the chart , but it stops at the Left:=LPos position in the code
With Sheets(Charts).ChartObjects.Add _
(Left:=LPos, Width:=WPos, Top:=TPos, Height:=HPos)
.Chart.ChartType = xlLine
.Chart.SetSourceData Source:=Sheets("DataRange").Range(ChartDataRange)
.Axes(xlValue).Select
.Axes(xlValue).MinimumScale = 0
.Axes(xlValue).MaximumScale = 40
.Axes(xlValue).MaximumScale = 45
.Axes(xlValue).MajorUnit = 5
.Axes(xlValue).MinorUnit = 1
.Legend.Select
.Position = xlTop
End With
How can i use the variable TPos , Wpos , HPos and LPos in the code.
Any help is welcome.
Mario
Bookmarks