Thursday, November 19, 2009

Excel Charts: Change Chart Series Type from Bar to Line

'--------------------------------------------------------------------------
' Macro to change Chart Series type to Line
' For this macro to work properly a bar chart has to be selected
'--------------------------------------------------------------------------
Sub ChangeSeriesType_Bar_to_Line()
Dim s As Series
For Each s In ActiveChart.SeriesCollection
With s
resp = MsgBox("Do you want to change series: " & Chr(34) & _
s.Name & Chr(34) & " type from Bar to Line?", vbYesNo)
If resp = vbYes Then
.ChartType = xlLineMarkers
End If
End With
Next s
End Sub

No comments:

Post a Comment