View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jon Peltier Jon Peltier is offline
external usenet poster
 
Posts: 6,582
Default Using chartspace in a user form

This macro adds a chart without needing data in the worksheet. You do
need a worksheet....

Sub ChartFromArrays()
Dim myChart As Chart
Set myChart = ActiveSheet.ChartObjects.Add(100, 100, 325, 250).Chart
With myChart
.SeriesCollection.NewSeries
.ChartType = xlXYScatterLines
With .SeriesCollection(1)
.Name = "The Series"
.Values = Array(1, 3, 5, 7, 9)
.XValues = Array(1.5, 2.5, 3.5, 4.5, 5.5)
End With
End With
End Sub

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
http://PeltierTech.com/Excel/Charts/
_______

Ola < wrote:

If I use the Picture-method, where do I create the picture when I donīt
have any data in a spread sheet? The data I want to use is uploaded
from Access and calculated in VBA.

/Ola


---
Message posted from http://www.ExcelForum.com/