Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
CLamar
 
Posts: n/a
Default Creating a plot in Excel with SeriesCollection

I have some code that makes a plot of some data that is in an Excel wksht.
The code makes a plot but it isnt correct. The code now, does two plots
where each series is a set of y-values. I want a plot where there is a
series collection for x and y - values (F column should be x and G column
should be y). Below is the code any modifications would be helpful

Sub VRHCharts()
Dim LastCellx As Long
Dim LastCelly As Long
On Error Resume Next
Application.DisplayAlerts = False
Charts("VRH1").Delete
On Error GoTo 0

With Worksheets("datatable")
LastCellx = .Cells(.Rows.Count, "F").End(xlUp).Row
LastCelly = .Cells(.Rows.Count, "G").End(xlUp).Row
End With

Application.ScreenUpdating = False
Charts.Add
ActiveChart.Name = "VRH1"
With ActiveChart
.SeriesCollection.NewSeries
.SeriesCollection.Add _
Source:=Worksheets("datatable").Range("f2:F" & LastCellx)
.SeriesCollection.Add _
Source:=Worksheets("datatable").Range("g2:G" & LastCelly)
.HasTitle = True
.ChartType = xlXYScatterSmooth
.HasLegend = False
.ApplyDataLabels Type:=xlDataLabelsShowValue
.Axes(xlCategory).TickLabels.Orientation = xlHorizontal
.ChartTitle.Font.Bold = True
.ChartTitle.Font.Size = 12
.PlotArea.Top = 18
.PlotArea.Height = 162
.Axes(xlValue).MaximumScale = 0.6
.Deselect
End With
Application.ScreenUpdating = True
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.charting
Don Guillett
 
Posts: n/a
Default Creating a plot in Excel with SeriesCollection

This was the proper place to post but I saw in .misc first. Please post in
ONE group only.

--
Don Guillett
SalesAid Software

"CLamar" wrote in message
...
I have some code that makes a plot of some data that is in an Excel wksht.
The code makes a plot but it isnt correct. The code now, does two plots
where each series is a set of y-values. I want a plot where there is a
series collection for x and y - values (F column should be x and G column
should be y). Below is the code any modifications would be helpful

Sub VRHCharts()
Dim LastCellx As Long
Dim LastCelly As Long
On Error Resume Next
Application.DisplayAlerts = False
Charts("VRH1").Delete
On Error GoTo 0

With Worksheets("datatable")
LastCellx = .Cells(.Rows.Count, "F").End(xlUp).Row
LastCelly = .Cells(.Rows.Count, "G").End(xlUp).Row
End With

Application.ScreenUpdating = False
Charts.Add
ActiveChart.Name = "VRH1"
With ActiveChart
.SeriesCollection.NewSeries
.SeriesCollection.Add _
Source:=Worksheets("datatable").Range("f2:F" & LastCellx)
.SeriesCollection.Add _
Source:=Worksheets("datatable").Range("g2:G" & LastCelly)
.HasTitle = True
.ChartType = xlXYScatterSmooth
.HasLegend = False
.ApplyDataLabels Type:=xlDataLabelsShowValue
.Axes(xlCategory).TickLabels.Orientation = xlHorizontal
.ChartTitle.Font.Bold = True
.ChartTitle.Font.Size = 12
.PlotArea.Top = 18
.PlotArea.Height = 162
.Axes(xlValue).MaximumScale = 0.6
.Deselect
End With
Application.ScreenUpdating = True
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.charting
CLamar
 
Posts: n/a
Default Creating a plot in Excel with SeriesCollection

Sorry about that but the guy that was helping me with the problem suggested
that i post it in here

"Don Guillett" wrote:

This was the proper place to post but I saw in .misc first. Please post in
ONE group only.

--
Don Guillett
SalesAid Software

"CLamar" wrote in message
...
I have some code that makes a plot of some data that is in an Excel wksht.
The code makes a plot but it isnt correct. The code now, does two plots
where each series is a set of y-values. I want a plot where there is a
series collection for x and y - values (F column should be x and G column
should be y). Below is the code any modifications would be helpful

Sub VRHCharts()
Dim LastCellx As Long
Dim LastCelly As Long
On Error Resume Next
Application.DisplayAlerts = False
Charts("VRH1").Delete
On Error GoTo 0

With Worksheets("datatable")
LastCellx = .Cells(.Rows.Count, "F").End(xlUp).Row
LastCelly = .Cells(.Rows.Count, "G").End(xlUp).Row
End With

Application.ScreenUpdating = False
Charts.Add
ActiveChart.Name = "VRH1"
With ActiveChart
.SeriesCollection.NewSeries
.SeriesCollection.Add _
Source:=Worksheets("datatable").Range("f2:F" & LastCellx)
.SeriesCollection.Add _
Source:=Worksheets("datatable").Range("g2:G" & LastCelly)
.HasTitle = True
.ChartType = xlXYScatterSmooth
.HasLegend = False
.ApplyDataLabels Type:=xlDataLabelsShowValue
.Axes(xlCategory).TickLabels.Orientation = xlHorizontal
.ChartTitle.Font.Bold = True
.ChartTitle.Font.Size = 12
.PlotArea.Top = 18
.PlotArea.Height = 162
.Axes(xlValue).MaximumScale = 0.6
.Deselect
End With
Application.ScreenUpdating = True
End Sub




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
unhide menu bar in excel - just disappeared Sean Setting up and Configuration of Excel 12 April 4th 23 10:19 AM
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER MEGTOM New Users to Excel 5 October 27th 05 03:06 AM
how do I create a 3-d plot in Excel? Clay Madden Charts and Charting in Excel 2 October 15th 05 01:57 PM
Excel creating temp files upon save. Joel Pratt Setting up and Configuration of Excel 2 May 18th 05 10:37 PM
PLEASE HELP!? Creating a simple database with excel, minor setback Pre-construction Manager & Excel !? Excel Worksheet Functions 1 November 30th 04 08:59 PM


All times are GMT +1. The time now is 04:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"