LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Ted Mifflin
 
Posts: n/a
Default Need for categories to be displayed in chart

I two problems with this program below. Although it does print the data
correctly on each of eleven sheets, I now only need the program to print
on sheets 2 and 9. Any idea how to change this FOr..Next staetment to
add that flexibikity?

The second problem I have is that the program doesn't display the data
category names on the finished chart. (I have data that exist in 6
columns (x and five y variables) and the category names are listed
directly above the five y variables). Unfortunately, the program only
prints the Legend with: Series 1, 2, 3, 4, and 5. I tried to add the
following lines to the program code below at the bottom but it crashed.

With cho.Chart
.SeriesCollection.Labels = True
.SeriesCategory.Labels = True
cho.Chart.ApplyDataLabels Type:=xlDataLabelsShow, LegendKey:=False
End With

How can I get the individual Category names to be displayed when I
use the following VBA code:

Sub OneChartPerSheet_v3()

Dim ws As Worksheet
Dim cho As ChartObject
Dim sRange As String
Dim dTop As Double
Dim dLeft As Double
Dim dHeight As Double
Dim dWidth As Double
Dim st As String

' change settings to suit
sRange = "$A$6:$F$37"
dTop = 45
dLeft = 460
dHeight = 350
dWidth = 320

For Each ws In ActiveWorkbook.Worksheets
Set cho = ws.ChartObjects.Add(dLeft, dTop, dWidth, dHeight)
'set chart type
cho.Chart.ChartType = xlXYScatter
With cho.Chart
.SetSourceData Source:=ws.Range(sRange), PlotBy:=xlColumns
' other chart formatting
.HasTitle = True
.ChartTitle.Characters.Text = ws.Range("A3")
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = _
"FAM Fluorescence, RFUs"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = _
"SR Fluorescence, RFUs"
.HasLegend = True
.Legend.Position = xlBottom
End With
Next
End Sub


-----------
Thanks for your time. I thought Excel macro programming would be easier
than this since this has been more of a challenge than I anticipated.

 
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
Editing a Chart Directly?? Charisma Riley Charts and Charting in Excel 3 January 26th 05 01:09 PM
Editing a Chart Directly?? CJ Charts and Charting in Excel 2 January 24th 05 08:15 PM
Problem with xlusrgal.xls file Alfred S C Lee Charts and Charting in Excel 2 December 29th 04 05:54 PM
Impedding/Overlaying Charts Phil Hageman Charts and Charting in Excel 4 December 17th 04 07:25 PM
pivot table multi line chart souris Charts and Charting in Excel 2 December 7th 04 03:56 AM


All times are GMT +1. The time now is 08:25 AM.

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

About Us

"It's about Microsoft Excel"