Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sanity is slipping!

Status
Not open for further replies.

Klo

Technical User
Aug 28, 2002
86
US
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






 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top