Sub ABC()
Dim ch As Chart
Charts.Add
MapPasteTo = 1
'Set r = Sheets("Test").Range("E" & _
MapPasteTo + 27 & ":Q" & MapPasteTo + 39)
ActiveChart.SetSourceData _
Source:=Sheets("Test").Range("E" & _
MapPasteTo + 27 & ":Q" & MapPasteTo + 39), _
PlotBy:=xlColumns
ActiveChart.ChartType = xlSurface
ActiveChart.Location Where:=xlLocationAsObject, Name:="Test"
Set ch = ActiveChart
With Worksheets("Test").Range("E" & MapPasteTo)
ch.Parent.Top = .Top
ch.Parent.Left = .Left
End With
End Sub
worked for me.
--
Regards,
Tom Ogilvy
"Fan924" wrote:
> Excel 97 macro copies data blocks to a sheet and plots a graph. This
> works well but the size and position is somwhat random. I would like
> it to appear below the data array and be about the same size. Can that
> be done?
>
> Charts.Add
> ActiveChart.ChartType = xlSurface
> ActiveChart.SetSourceData Source:=Sheets("Test").Range("E" &
> MapPasteTo + 27 & ":Q" & MapPasteTo + 39), _
> PlotBy:=xlColumns
> ActiveChart.Location Where:=xlLocationAsObject, Name:="Test"
>
>
|