Well I know the answer is staring right at me but I can't find it. I can create a chart manually in Excel 2000 OK and even record a macro, but when i try to run the macro I get error 13, Type Mismatch on ActiveChart.SetSourceData Source:=Sheets("WBC Data").Rows("1:1"), PlotBy:= _
xlRows. (The x-axis data and y-axis data are in two different sheets in the same workbook.)
Any ideas?
Sub Macro4()
'
' Macro4 Macro
' Macro recorded 08/30/2004
'
'
Charts.Add
ActiveChart.ChartType = xlXYScatterSmoothNoMarkers
ActiveChart.SetSourceData Source:=Sheets("WBC Data").Rows("1:1"), PlotBy:= _
xlRows
ActiveChart.SeriesCollection(1).XValues = "='WBC X-Axis'!R1"
ActiveChart.SeriesCollection(1).Name = "=""WBC Histogram"""
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="WBC Histogram"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "WBC Histogram"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Femtoliters"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Lysate-Modified WBC"
End With
ActiveChart.HasLegend = False
End Sub
xlRows. (The x-axis data and y-axis data are in two different sheets in the same workbook.)
Any ideas?
Sub Macro4()
'
' Macro4 Macro
' Macro recorded 08/30/2004
'
'
Charts.Add
ActiveChart.ChartType = xlXYScatterSmoothNoMarkers
ActiveChart.SetSourceData Source:=Sheets("WBC Data").Rows("1:1"), PlotBy:= _
xlRows
ActiveChart.SeriesCollection(1).XValues = "='WBC X-Axis'!R1"
ActiveChart.SeriesCollection(1).Name = "=""WBC Histogram"""
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="WBC Histogram"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "WBC Histogram"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Femtoliters"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Lysate-Modified WBC"
End With
ActiveChart.HasLegend = False
End Sub