excel vba
RH

Forum home » Delegate support and help forum » Microsoft VBA Training and help » Excel VBA

Excel VBA

resolvedResolved · 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 courses

 

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
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

VBA tip:

Empty The Clipboard with CutCopyMode

After 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:

ActiveSheet.Paste
Application.CutCopyMode = False

View all VBA hints and tips


Server loaded in 0.05 secs.