-
VBA 2011 Overlapping Datalabels
following this thread.
I use this code to toggle the data labels on a line chart:
[vba]Sub ToggleDataLabelsSecondAxis1()
Dim lngSeries As Long
Dim xx As DataLabels
With ActiveSheet.ChartObjects(1).Chart.SeriesCollection(5)
.HasDataLabels = Not .HasDataLabels
If .HasDataLabels Then
With .DataLabels
.ShowCategoryName = False
.ShowValue = True
.ShowSeriesName = False
.Orientation = 90
.Position = 0
End With
End If
End With
End Sub
[/vba]
and for the other line:
[vba]Sub ToggleDataLabelsSecondAxis2()
Dim lngSeries As Long
Dim xx As DataLabels
With ActiveSheet.ChartObjects(1).Chart.SeriesCollection(6)
.HasDataLabels = Not .HasDataLabels
If .HasDataLabels Then
With .DataLabels
.ShowCategoryName = False
.ShowValue = True
.ShowSeriesName = False
.Orientation = 90
.Position = 1
End With
End If
End With
End Sub
[/vba]
What code would you suggest to avoid having data labels overlapping for similar data.
Eg
67.46 78.29 67.63 72.12 86.12 75.84 Those are close enough to make some labels unreadable.
Adjusting manually (although possible) would be counter productive as pdf (another thread / feature) are create on the go.
Thnks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules