ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   Annotate Chart with Text Boxes (https://www.excelbanter.com/charts-charting-excel/225099-annotate-chart-text-boxes.html)

Pete[_5_]

Annotate Chart with Text Boxes
 
I have some charts that are annotated with Text Boxes that line up
with that Months data. If I add extra months to the Chart then I have
to move all the Text boxes along a little to the left to remain
matched up with the Data it corresponds to, can this be automatically
done?

Thanks

Pete

Andy Pope

Annotate Chart with Text Boxes
 
Hi,

Textboxes by themselves will not track your monthly data. For that you
would need to use data labels.
To update the textboxes would require VBA code to calculate there
position in relation to the chart and the data.

Cheers
Andy

Pete wrote:
I have some charts that are annotated with Text Boxes that line up
with that Months data. If I add extra months to the Chart then I have
to move all the Text boxes along a little to the left to remain
matched up with the Data it corresponds to, can this be automatically
done?

Thanks

Pete


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

Pete[_5_]

Annotate Chart with Text Boxes
 
On Mar 22, 11:57*am, Andy Pope wrote:
Hi,

Textboxes by themselves will not track your monthly data. For that you
would need to use data labels.
To update the textboxes would require VBA code to calculate there
position in relation to the chart and the data.

Cheers
Andy

Pete wrote:
I have some charts that are annotated with Text Boxes that line up
with that Months data. If I add extra months to the Chart then I have
to move all the Text boxes along a little to the left to remain
matched up with the Data it corresponds to, can this be automatically
done?


Thanks


Pete


--

Andy Pope, Microsoft MVP - Excelhttp://www.andypope.info


Andy,
I think I've misled you. I don't want to update the Text in the Text
Boxes I just want them to remain lined up with the Month that they
correspond to when extend the Range of the Source Data for the Chart.

Jon Peltier

Annotate Chart with Text Boxes
 
That's what Andy was referring to, by "calculating their position".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"Pete" wrote in message
...
On Mar 22, 11:57 am, Andy Pope wrote:
Hi,

Textboxes by themselves will not track your monthly data. For that you
would need to use data labels.
To update the textboxes would require VBA code to calculate there
position in relation to the chart and the data.

Cheers
Andy

Pete wrote:
I have some charts that are annotated with Text Boxes that line up
with that Months data. If I add extra months to the Chart then I have
to move all the Text boxes along a little to the left to remain
matched up with the Data it corresponds to, can this be automatically
done?


Thanks


Pete


--

Andy Pope, Microsoft MVP - Excelhttp://www.andypope.info


Andy,
I think I've misled you. I don't want to update the Text in the Text
Boxes I just want them to remain lined up with the Month that they
correspond to when extend the Range of the Source Data for the Chart.



Pete[_5_]

Annotate Chart with Text Boxes
 
On Mar 22, 4:06*pm, "Jon Peltier"
wrote:
That's what Andy was referring to, by "calculating their position".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.http://PeltierTech.com/WordPress/
_______

"Pete" wrote in message

...
On Mar 22, 11:57 am, Andy Pope wrote:





Hi,


Textboxes by themselves will not track your monthly data. For that you
would need to use data labels.
To update the textboxes would require VBA code to calculate there
position in relation to the chart and the data.


Cheers
Andy


Pete wrote:
I have some charts that are annotated with Text Boxes that line up
with that Months data. If I add extra months to the Chart then I have
to move all the Text boxes along a little to the left to remain
matched up with the Data it corresponds to, can this be automatically
done?


Thanks


Pete


--


Andy Pope, Microsoft MVP - Excelhttp://www.andypope.info


Andy,
I think I've misled you. I don't want to update the Text in the Text
Boxes I just want them to remain lined up with the Month that they
correspond to when extend the Range of the Source Data for the Chart.- Hide quoted text -

- Show quoted text -


Hi,

Don't suppose you could give an example of the code required or know
where there is an example. VBA is not my strong point.

Thanks

Peter

Jon Peltier

Annotate Chart with Text Boxes
 
Why don't you top post like everyone else, so it's easier to find what you
have written?

Andy said it "would require" VBA to keep the labels in position. But if you
use data labels it wouldn't.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"Pete" wrote in message
...
On Mar 22, 4:06 pm, "Jon Peltier"
wrote:
That's what Andy was referring to, by "calculating their position".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.http://PeltierTech.com/WordPress/
_______

"Pete" wrote in message

...
On Mar 22, 11:57 am, Andy Pope wrote:





Hi,


Textboxes by themselves will not track your monthly data. For that you
would need to use data labels.
To update the textboxes would require VBA code to calculate there
position in relation to the chart and the data.


Cheers
Andy


Pete wrote:
I have some charts that are annotated with Text Boxes that line up
with that Months data. If I add extra months to the Chart then I have
to move all the Text boxes along a little to the left to remain
matched up with the Data it corresponds to, can this be automatically
done?


Thanks


Pete


--


Andy Pope, Microsoft MVP - Excelhttp://www.andypope.info


Andy,
I think I've misled you. I don't want to update the Text in the Text
Boxes I just want them to remain lined up with the Month that they
correspond to when extend the Range of the Source Data for the Chart.-
Hide quoted text -

- Show quoted text -


Hi,

Don't suppose you could give an example of the code required or know
where there is an example. VBA is not my strong point.

Thanks

Peter



Andy Pope

Annotate Chart with Text Boxes
 
Hi,

Here is a simple coded approach to the problem if using data labels alone is
not sufficient for the formatting of your annotation.

Start by adding a dummy series to the chart. Make sure the Series name is
blank or a single space.
Use the same values as the main series. Apply data labels to this series.
The Left and Top property of the data labels can now be used to re-position
textboxes.

Sub Demo()

Dim chtTemp As Chart
Dim shpTemp As Shape

With ActiveSheet.ChartObjects(1).Chart
Set shpTemp = .Shapes("Text Box 1")
With .SeriesCollection(2).DataLabels(3)
shpTemp.Left = .Left
shpTemp.Top = .Top
End With
End With

End Sub

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Pete" wrote in message
...
On Mar 22, 4:06 pm, "Jon Peltier"
wrote:
That's what Andy was referring to, by "calculating their position".

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.http://PeltierTech.com/WordPress/
_______

"Pete" wrote in message

...
On Mar 22, 11:57 am, Andy Pope wrote:





Hi,


Textboxes by themselves will not track your monthly data. For that you
would need to use data labels.
To update the textboxes would require VBA code to calculate there
position in relation to the chart and the data.


Cheers
Andy


Pete wrote:
I have some charts that are annotated with Text Boxes that line up
with that Months data. If I add extra months to the Chart then I have
to move all the Text boxes along a little to the left to remain
matched up with the Data it corresponds to, can this be automatically
done?


Thanks


Pete


--


Andy Pope, Microsoft MVP - Excelhttp://www.andypope.info


Andy,
I think I've misled you. I don't want to update the Text in the Text
Boxes I just want them to remain lined up with the Month that they
correspond to when extend the Range of the Source Data for the Chart.-
Hide quoted text -

- Show quoted text -


Hi,

Don't suppose you could give an example of the code required or know
where there is an example. VBA is not my strong point.

Thanks

Peter


Pete[_5_]

Annotate Chart with Text Boxes
 
Sorry Jon, didn't realise I was doing anything wrong, I just hit the
Reply Button. I thought Data Labels were just a copy of the Values
used for the Chart. I didn't realise you could Edit them.

Peter


On 23 Mar, 22:19, "Jon Peltier"
wrote:
Why don't you top post like everyone else, so it's easier to find what you
have written?

Andy said it "would require" VBA to keep the labels in position. But if you
use data labels it wouldn't.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.http://PeltierTech.com/WordPress/
_______

"Pete" wrote in message

...
On Mar 22, 4:06 pm, "Jon Peltier"
wrote:





That's what Andy was referring to, by "calculating their position".


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.http://PeltierTech.com/WordPress/
_______


"Pete" wrote in message


...
On Mar 22, 11:57 am, Andy Pope wrote:


Hi,


Textboxes by themselves will not track your monthly data. For that you
would need to use data labels.
To update the textboxes would require VBA code to calculate there
position in relation to the chart and the data.


Cheers
Andy


Pete wrote:
I have some charts that are annotated with Text Boxes that line up
with that Months data. If I add extra months to the Chart then I have
to move all the Text boxes along a little to the left to remain
matched up with the Data it corresponds to, can this be automatically
done?


Thanks


Pete


--


Andy Pope, Microsoft MVP - Excelhttp://www.andypope.info


Andy,
I think I've misled you. I don't want to update the Text in the Text
Boxes I just want them to remain lined up with the Month that they
correspond to when extend the Range of the Source Data for the Chart.-
Hide quoted text -


- Show quoted text -


Hi,

Don't suppose you could give an example of the code required or know
where there is an example. VBA is not my strong point.

Thanks

Peter- Hide quoted text -

- Show quoted text -



Andy Pope

Annotate Chart with Text Boxes
 
Check out Rob's free add-in which will link data labels to cell text.
http://www.appspro.com/Utilities/ChartLabeler.htm

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Pete" wrote in message
...
Sorry Jon, didn't realise I was doing anything wrong, I just hit the
Reply Button. I thought Data Labels were just a copy of the Values
used for the Chart. I didn't realise you could Edit them.

Peter


On 23 Mar, 22:19, "Jon Peltier"
wrote:
Why don't you top post like everyone else, so it's easier to find what
you
have written?

Andy said it "would require" VBA to keep the labels in position. But if
you
use data labels it wouldn't.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.http://PeltierTech.com/WordPress/
_______

"Pete" wrote in message

...
On Mar 22, 4:06 pm, "Jon Peltier"
wrote:





That's what Andy was referring to, by "calculating their position".


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.http://PeltierTech.com/WordPress/
_______


"Pete" wrote in message


...
On Mar 22, 11:57 am, Andy Pope wrote:


Hi,


Textboxes by themselves will not track your monthly data. For that
you
would need to use data labels.
To update the textboxes would require VBA code to calculate there
position in relation to the chart and the data.


Cheers
Andy


Pete wrote:
I have some charts that are annotated with Text Boxes that line up
with that Months data. If I add extra months to the Chart then I
have
to move all the Text boxes along a little to the left to remain
matched up with the Data it corresponds to, can this be
automatically
done?


Thanks


Pete


--


Andy Pope, Microsoft MVP - Excelhttp://www.andypope.info


Andy,
I think I've misled you. I don't want to update the Text in the Text
Boxes I just want them to remain lined up with the Month that they
correspond to when extend the Range of the Source Data for the Chart.-
Hide quoted text -


- Show quoted text -


Hi,

Don't suppose you could give an example of the code required or know
where there is an example. VBA is not my strong point.

Thanks

Peter- Hide quoted text -

- Show quoted text -




Pete[_5_]

Annotate Chart with Text Boxes
 
Thanks, will give it a try.
Peter

On Mar 24, 9:28*am, "Andy Pope" wrote:
Check out Rob's free add-in which will link data labels to cell text.http://www.appspro.com/Utilities/ChartLabeler.htm

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excelhttp://www.andypope.info"Pete" wrote in message

...



Sorry Jon, didn't realise I was doing anything wrong, I just hit the
Reply Button. I thought Data Labels were just a copy of the Values
used for the Chart. I didn't realise you could Edit them.


Peter


On 23 Mar, 22:19, "Jon Peltier"
wrote:
Why don't you top post like everyone else, so it's easier to find what
you
have written?


Andy said it "would require" VBA to keep the labels in position. But if
you
use data labels it wouldn't.


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.http://PeltierTech.com/WordPress/
_______


"Pete" wrote in message


....
On Mar 22, 4:06 pm, "Jon Peltier"
wrote:


That's what Andy was referring to, by "calculating their position".


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.http://PeltierTech.com/WordPress/
_______


"Pete" wrote in message


...
On Mar 22, 11:57 am, Andy Pope wrote:


Hi,


Textboxes by themselves will not track your monthly data. For that
you
would need to use data labels.
To update the textboxes would require VBA code to calculate there
position in relation to the chart and the data.


Cheers
Andy


Pete wrote:
I have some charts that are annotated with Text Boxes that line up
with that Months data. If I add extra months to the Chart then I
have
to move all the Text boxes along a little to the left to remain
matched up with the Data it corresponds to, can this be
automatically
done?


Thanks


Pete


--


Andy Pope, Microsoft MVP - Excelhttp://www.andypope.info


Andy,
I think I've misled you. I don't want to update the Text in the Text
Boxes I just want them to remain lined up with the Month that they
correspond to when extend the Range of the Source Data for the Chart..-
Hide quoted text -


- Show quoted text -


Hi,


Don't suppose you could give an example of the code required or know
where there is an example. VBA is not my strong point.


Thanks


Peter- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -




All times are GMT +1. The time now is 12:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com