S
Sammy
Hello all
The following macro is the final part of a routine that will creates a
chart.
What code would I need to insert that would test the activecell for
entries and if none print a message like "No data to Chart".
Thanks for any help.
Sammy
Sub MakeChart
Sheets("Build Chart").Select
ActiveCell.CurrentRegion.Select
Charts.Add
ActiveChart.ChartType = xlColumnClustered
On Error Resume Next
ActiveChart.SeriesCollection(1).Name = "=""Forecast"""
ActiveChart.SeriesCollection(2).Name = "=""Returned"""
ActiveChart.Location Where:=xlLocationAsObject, Name:="Chart"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "2003/4"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
"Categories"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Hours"
End With
ActiveChart.ApplyDataLabels Type:=xlDataLabelsShowValue,
LegendKey:=False
ActiveChart.HasDataTable = True
ActiveChart.DataTable.ShowLegendKey = True
Call CoverRangeWithAChart
End Sub
The following macro is the final part of a routine that will creates a
chart.
What code would I need to insert that would test the activecell for
entries and if none print a message like "No data to Chart".
Thanks for any help.
Sammy
Sub MakeChart
Sheets("Build Chart").Select
ActiveCell.CurrentRegion.Select
Charts.Add
ActiveChart.ChartType = xlColumnClustered
On Error Resume Next
ActiveChart.SeriesCollection(1).Name = "=""Forecast"""
ActiveChart.SeriesCollection(2).Name = "=""Returned"""
ActiveChart.Location Where:=xlLocationAsObject, Name:="Chart"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "2003/4"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
"Categories"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Hours"
End With
ActiveChart.ApplyDataLabels Type:=xlDataLabelsShowValue,
LegendKey:=False
ActiveChart.HasDataTable = True
ActiveChart.DataTable.ShowLegendKey = True
Call CoverRangeWithAChart
End Sub