Chart appearing as a picture??

I

Ian

Hi all

Im trying to produce several charts on a worksheet using the code below,
however the chart appears on the worksheet as a picture and I cant do any
formatting of the exis etc

Ive no doubt doen somthing wrong but fro the life of me I cant find it

any help would be great

Cheers

Ian

Sub Porosity_Plot()

Dim rng As Range
Dim sh1 As Worksheet
Dim a3_plot As Worksheet
Dim x As Integer
Dim porosity_col As Integer




Set sh1 = ThisWorkbook.Sheets("Poro-Perm Data Entry")
Set rng = sh1.Range("b12:av" & sh1.Range("b12").End(xlDown).Row)
'Set test = sh1.Cells.SpecialCells(xlCellTypeLastCell)

Sheets.Add
ActiveSheet.Name = "plotting"


AND

Sub Add_Chart()

'ActiveSheet.ChartObject.Add

With ActiveSheet.ChartObjects.Add _
(Left:=100, Width:=375, Top:=75, Height:=225)
.Chart.ChartType = xlXYScatterLines

End With



'ActiveChart.ChartType = xlXYScatterLinesNoMarkers
plot_page_setup
 
T

Tom Ogilvy

Help for ChartObject says:

Use the Add method to create a new, empty embedded chart and add it to the
collection. Use the ChartWizard method to add data and format the new chart.
The following example creates a new embedded chart and then adds the data
from cells A1:A20 as a line chart.

Dim ch As ChartObject
Set ch = Worksheets("sheet1").ChartObjects.Add(100, 30, 400, 250)
ch.Chart.ChartWizard source:=Worksheets("sheet1").Range("a1:a20"), _
gallery:=xlLine, title:="New Chart"
 

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