below macro adds a text box to the first chart of the active worksheet. The contents for the text box is taken from a cell that has been named Blue_Range_TextBox_01.
There are seven charts on the active worksheet and seven text boxes to be added.
The contents for these textboxes have to be taken from cells named ...
So, my requirements for the macro is as follows:
The code is to loop thru all the names (Blue_Range_TextBox_xx) and add a text box to each and every chart with the Chart number (Chart.Objects(1 or 2 or 3 etc.)) corresponding with the number at the end of the named ranges (Blue_Range_Text_Box_01 or _02 or _03 etc.).
I hope I could make myself clear.
Help is much appreciated. Thank you very much in advance.
I have attached a sample file (with below code included) for your convenience.
Again, thank you very much for your professional help.
Dim chtTemp As Chart
Dim objTemp As Object
Set chtTemp = ActiveSheet.ChartObjects(1).Chart
Set objTemp = chtTemp.Shapes.AddTextBox(msoTextOrientationHorizontal, 250, 174, 140, 20)
Selection.Formula = "='" & chtTemp.Parent.Parent.Name & "'!Blue_Range_TextBox_01"