Hi
The following code was written to color a data label. everything is fine, but when file is saved and then reopened, all data label including the empty labels are colored as well, which creats an ugly chart!
Please help
The following code was written to color a data label. everything is fine, but when file is saved and then reopened, all data label including the empty labels are colored as well, which creats an ugly chart!
Please help
Code:
With .SeriesCollection.NewSeries
.Name = "=" & COM.Name & "!R10C4"
.Values = "=" & COM.Name & "!R" & 12 & "C2:R" & COM.Cells(1, 1).Value & "C2"
.XValues = "=" & COM.Name & "!R" & 12 & "C1:R" & COM.Cells(1, 1).Value & "C1"
.Border.Color = RGB(0, 102, 204)
.Format.Line.Weight = 0.1
.Format.Line.DashStyle = msoLineSysDot
End With
.SeriesCollection("WSM").Select
.SeriesCollection("WSM").ApplyDataLabels
.SeriesCollection("WSM").DataLabels.Select
.SeriesCollection("WSM").DataLabels.Select
.SeriesCollection("WSM").DataLabels.Format.TextFrame2.TextRange. _
InsertChartField msoChartFieldRange, _
"=" & COM.Name & "!R" & 12 & "C" & (Currcol + 2) & ":R" & COM.Cells(1, 1).Value & "C" & (Currcol + 2) _
, 0
Selection.ShowRange = True
Selection.ShowValue = False
Selection.Orientation = xlUpward
Selection.Format.TextFrame2.Orientation = msoTextOrientationUpward
Selection.Font.Size = 9
Selection.Position = xlLabelPositionAbove
With Selection.Format.fill
.Visible = msoTrue
.ForeColor.RGB = RGB(255, 255, 0)
.Transparency = 0.3
.Solid
End With