PDA

View Full Version : VBA PLOT JUMP ROW



fabio.geraci
08-18-2010, 04:05 AM
Hello everyone,

First of all I would like to apologize of not posting a sample code that you can comment on, but i think it would be trivial.

Now, I would like to create a macro to plot a series where whenever it encounters a empty cell it put a gap in the plot.

Cheers for the help

fabio.geraci
08-18-2010, 07:43 AM
The following code should do it, but it only work when some of the cells are blank (empty). at the moment they come from a function which displys a number if a condition is satisfied, if not it puts "".

"" is not blank (empty) how can i make the cell blank?

Sub plot_gaps_2003()
'
' plot_gaps_2003 Macro
' Macro recorded 18/08/2010 by fgeraci
'
'
Charts.Add
ActiveChart.ChartType = xlXYScatterLines
' ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = "=BSC!R10C1:R43C1"
ActiveChart.SeriesCollection(1).Values = "=BSC!R10C7:R43C7"
ActiveChart.DisplayBlanksAs = xlNotPlotted
ActiveChart.Location Where:=xlLocationAsObject, Name:="BSC"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "sada"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "fdghfd"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "rttyrty"
End With
End Sub