98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft VBA Training and help » Excel VBA
Excel VBA
Resolved · High Priority · Version 2007
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
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
VBA tip:Empty The Clipboard with CutCopyModeAfter each Copy/Paste operation in VBA, you should use the following line of code to empty the clipboard. This ensures that the computer memory doesn't overload: |