Steve has attended:
Excel VBA Intro Intermediate course
Excel VBA
IN a 2-d clustered bar chart how can you superscript a portion of the text on the data label. The label option is set to category name.
Each data points category name is a different length, but I want to be able to add a number at the end of the category name and format it as superscript. I've tried using the macro recorder to create the code but when you try and run it the following error message occur's:
"Run-time error '-2147024809 (80070057)':
The index into the specified collection is out of bounds."
This is the code created by the macro recorder.
ActiveChart.ChartArea.Select
ActiveChart.SeriesCollection(2).DataLabels.Select
ActiveChart.SeriesCollection(2).Points(6).DataLabel.Select
Selection.Format.TextFrame2.TextRange.Characters(20, 1).Font.BaselineOffset = _
0.3
ActiveChart.SeriesCollection(2).Points(6).DataLabel.Text = _
"Currency 1"
RE: Excel VBA
Hi Steve, thanks for your query. Try the code at this link:
http://www.mrexcel.com/forum/showthread.php?t=556829
...but note the problems across versions. See how you get on, and try a succession of macros to split the process up - one to drill into the label, then to select text, then to superscript etc.
Hope this helps,
Anthony