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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

chart showing too many lines!

Status
Not open for further replies.

drewdaman

Programmer
Aug 5, 2003
302
CA
i thought a new post would be appropriate.

i am trying to graph something.. (in my earlier post i said that i do not want to display the coordinates for the chart on the spreadsheet, but I CHANGED MY MIND!).

so.. now i have coordinates on the spreadsheet. i recorded a macro to draw the graph.

i calculate teh coordinates, write them to the spreadsheet. i took the RECORDED code and copied and pasted it in my code. it gives me a ton of lines.. (many graphs on a single coordinate axes). but when i recorded the macro, it correctly displayed a single graph on a single coordinate axes.

this is the code
Code:
Sub doGraphwaftercost()
 Charts.Add
    ActiveChart.ChartType = xlXYScatterSmoothNoMarkers
    ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A12:B20")
    ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
End Sub

thanks for any help!
 


Are you adding a Chart each time you run this code?

You use "graphs" as if you mean series.

Did you mean to say ...many series on a single coordinate axes...

Please post a sample of your source data.

Skip,

[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue]
 
thanks for your reply..
yes i do mean series..
i think my problem was that i didn't do a range select before the code i posted.

sorry for asking such basic questions.. i'm not really a VB guy!
 


BEFORE you record any code, you must know what you are doing with creating and/or assigning values/ranges to your series.

Get that down cold and THEN macro record doing EXACTLY what you intend without any junk.

Skip,

[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top