1

I am writing a loop to create and format an XY scatter chart in Excel 2010. In my loop I added .ApplyDataLabels ShowSeriesName:=True and the series name shows up in my chart but the Y value label is added as well. To remove the Y value label I added .ApplyDataLabels ShowValue:=False to my code but that turns off the series name label as well. Here is my code:

If (Range("Q" & m) >= 40 And Range("R" & m) >= 40) Then
.ApplyDataLabels ShowSeriesName:=True
.ApplyDataLabels ShowValue:=False 'set to false because it didn't work
End If

Basically I only need the series name to show up in my chart, not the series name and Y value label. Has anybody else had this problem or know a way around it?

1 Answer 1

2

Try to set both parameters in one line, like:

If (Range("Q" & m) >= 40 And Range("R" & m) >= 40) Then
   .ApplyDataLabels ShowSeriesName:=True, ShowValue:=False
End If

And give us information if anything changed. If not, please add With... line to your code.

1
  • Thank you very much for the quick reply. Adding ShowValue:=False to the same line as ShowSeriesName solved my issue. You're the best!
    – Marc
    Apr 3, 2013 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.