Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
AK AK is offline
external usenet poster
 
Posts: 56
Default XY Chart Label - second request for help

Need the help up of the Excel gurus..

I'm using Rob Bovey's XY Chart labeler to label a Red, Yellow, and Green XY
chart.

By the way...this add-in is great!!!

The data for the charts are built from dynamic named ranges for both X and
Y. I have a helper column for the labels that is a dynamic named range as
well. All data is linked to an MS Access db.

Here's what I'm trying to do:
The data for the charts will change whenever I load the file with new data
and was wondering if anyone knew how to create a macro to call up the Add In
and place the dynamic named range in the "... Label Range" field for each
Red, Yellow, and Green data series.

I would then repeat this macro for each XY chart in the file.

Many many thanks in advance.

AK


  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default XY Chart Label - second request for help

AFAIK, Rob's utility doesn't have convenient hooks for external VBA routines
to use. I've frequently rolled my own routine to apply labels. This tends to
be smaller than Rob's without as much error handling, and is specific to the
particular solution I'm working on. Essentially it finds the range based on
whatever VBA or Name/Refers To definitions you use, and goes cell by cell to
apply the labels and if desired the formats.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"AK" wrote in message
...
Need the help up of the Excel gurus..

I'm using Rob Bovey's XY Chart labeler to label a Red, Yellow, and Green
XY
chart.

By the way...this add-in is great!!!

The data for the charts are built from dynamic named ranges for both X and
Y. I have a helper column for the labels that is a dynamic named range as
well. All data is linked to an MS Access db.

Here's what I'm trying to do:
The data for the charts will change whenever I load the file with new data
and was wondering if anyone knew how to create a macro to call up the Add
In
and place the dynamic named range in the "... Label Range" field for each
Red, Yellow, and Green data series.

I would then repeat this macro for each XY chart in the file.

Many many thanks in advance.

AK




  #3   Report Post  
Posted to microsoft.public.excel.charting
AK AK is offline
external usenet poster
 
Posts: 56
Default XY Chart Label - second request for help

Hi Jon:

Thanks. What is "AFAIK"?

Could I trouble you for the code I'd use for a dynamic named range named
"GreenDots"?

Thanks in advance,

"Jon Peltier" wrote:

AFAIK, Rob's utility doesn't have convenient hooks for external VBA routines
to use. I've frequently rolled my own routine to apply labels. This tends to
be smaller than Rob's without as much error handling, and is specific to the
particular solution I'm working on. Essentially it finds the range based on
whatever VBA or Name/Refers To definitions you use, and goes cell by cell to
apply the labels and if desired the formats.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"AK" wrote in message
...
Need the help up of the Excel gurus..

I'm using Rob Bovey's XY Chart labeler to label a Red, Yellow, and Green
XY
chart.

By the way...this add-in is great!!!

The data for the charts are built from dynamic named ranges for both X and
Y. I have a helper column for the labels that is a dynamic named range as
well. All data is linked to an MS Access db.

Here's what I'm trying to do:
The data for the charts will change whenever I load the file with new data
and was wondering if anyone knew how to create a macro to call up the Add
In
and place the dynamic named range in the "... Label Range" field for each
Red, Yellow, and Green data series.

I would then repeat this macro for each XY chart in the file.

Many many thanks in advance.

AK





  #4   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default XY Chart Label - second request for help

AFAIK = as far as I know

You would do something like this (caution: air code)

Sub LabelSeriesOne()
Dim srs As Series
Dim iPoint As Long
Dim rLabels As Range

Set srs = ActiveSheet.ChartObjects(1).Chart.SeriesCollection (1)
Set rLabels = ActiveSheet.Range("GreenDots")
For iPoint = 1 To srs.Points.Count
srs.Points(iPoint).HasDataLabel = True
srs.Points(iPoint).DataLabel.Characters.Text =
rLabels.Cells(iPoint).Value
Next
End Sub

You can also get the font format of the cell and apply it to the label,
which Rob's utility does.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"AK" wrote in message
...
Hi Jon:

Thanks. What is "AFAIK"?

Could I trouble you for the code I'd use for a dynamic named range named
"GreenDots"?

Thanks in advance,

"Jon Peltier" wrote:

AFAIK, Rob's utility doesn't have convenient hooks for external VBA
routines
to use. I've frequently rolled my own routine to apply labels. This tends
to
be smaller than Rob's without as much error handling, and is specific to
the
particular solution I'm working on. Essentially it finds the range based
on
whatever VBA or Name/Refers To definitions you use, and goes cell by cell
to
apply the labels and if desired the formats.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"AK" wrote in message
...
Need the help up of the Excel gurus..

I'm using Rob Bovey's XY Chart labeler to label a Red, Yellow, and
Green
XY
chart.

By the way...this add-in is great!!!

The data for the charts are built from dynamic named ranges for both X
and
Y. I have a helper column for the labels that is a dynamic named range
as
well. All data is linked to an MS Access db.

Here's what I'm trying to do:
The data for the charts will change whenever I load the file with new
data
and was wondering if anyone knew how to create a macro to call up the
Add
In
and place the dynamic named range in the "... Label Range" field for
each
Red, Yellow, and Green data series.

I would then repeat this macro for each XY chart in the file.

Many many thanks in advance.

AK







  #5   Report Post  
Posted to microsoft.public.excel.charting
AK AK is offline
external usenet poster
 
Posts: 56
Default XY Chart Label - second request for help

Hi Jon:

The code errors at

srs.Points(iPoint).HasDataLabel = True

Would you know what the issue is?

THanks,


"Jon Peltier" wrote:

AFAIK = as far as I know

You would do something like this (caution: air code)

Sub LabelSeriesOne()
Dim srs As Series
Dim iPoint As Long
Dim rLabels As Range

Set srs = ActiveSheet.ChartObjects(1).Chart.SeriesCollection (1)
Set rLabels = ActiveSheet.Range("GreenDots")
For iPoint = 1 To srs.Points.Count
srs.Points(iPoint).HasDataLabel = True
srs.Points(iPoint).DataLabel.Characters.Text =
rLabels.Cells(iPoint).Value
Next
End Sub

You can also get the font format of the cell and apply it to the label,
which Rob's utility does.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"AK" wrote in message
...
Hi Jon:

Thanks. What is "AFAIK"?

Could I trouble you for the code I'd use for a dynamic named range named
"GreenDots"?

Thanks in advance,

"Jon Peltier" wrote:

AFAIK, Rob's utility doesn't have convenient hooks for external VBA
routines
to use. I've frequently rolled my own routine to apply labels. This tends
to
be smaller than Rob's without as much error handling, and is specific to
the
particular solution I'm working on. Essentially it finds the range based
on
whatever VBA or Name/Refers To definitions you use, and goes cell by cell
to
apply the labels and if desired the formats.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"AK" wrote in message
...
Need the help up of the Excel gurus..

I'm using Rob Bovey's XY Chart labeler to label a Red, Yellow, and
Green
XY
chart.

By the way...this add-in is great!!!

The data for the charts are built from dynamic named ranges for both X
and
Y. I have a helper column for the labels that is a dynamic named range
as
well. All data is linked to an MS Access db.

Here's what I'm trying to do:
The data for the charts will change whenever I load the file with new
data
and was wondering if anyone knew how to create a macro to call up the
Add
In
and place the dynamic named range in the "... Label Range" field for
each
Red, Yellow, and Green data series.

I would then repeat this macro for each XY chart in the file.

Many many thanks in advance.

AK










  #6   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default XY Chart Label - second request for help

It worked on a simple 3-point series for me. Is the value of this point
#N/A? Try this refinement:


Sub LabelSeriesOne()
Dim srs As Series
Dim iPoint As Long
Dim rLabels As Range

Set srs = ActiveSheet.ChartObjects(1).Chart.SeriesCollection (1)
Set rLabels = ActiveSheet.Range("GreenDots")
For iPoint = 1 To srs.Points.Count
If IsNumeric(srs.Values(iPoint)) Then
srs.Points(iPoint).HasDataLabel = True
srs.Points(iPoint).DataLabel.Characters.Text =
rLabels.Cells(iPoint).Value
End If
Next
End Sub


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"AK" wrote in message
...
Hi Jon:

The code errors at

srs.Points(iPoint).HasDataLabel = True

Would you know what the issue is?

THanks,


"Jon Peltier" wrote:

AFAIK = as far as I know

You would do something like this (caution: air code)

Sub LabelSeriesOne()
Dim srs As Series
Dim iPoint As Long
Dim rLabels As Range

Set srs = ActiveSheet.ChartObjects(1).Chart.SeriesCollection (1)
Set rLabels = ActiveSheet.Range("GreenDots")
For iPoint = 1 To srs.Points.Count
srs.Points(iPoint).HasDataLabel = True
srs.Points(iPoint).DataLabel.Characters.Text =
rLabels.Cells(iPoint).Value
Next
End Sub

You can also get the font format of the cell and apply it to the label,
which Rob's utility does.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"AK" wrote in message
...
Hi Jon:

Thanks. What is "AFAIK"?

Could I trouble you for the code I'd use for a dynamic named range
named
"GreenDots"?

Thanks in advance,

"Jon Peltier" wrote:

AFAIK, Rob's utility doesn't have convenient hooks for external VBA
routines
to use. I've frequently rolled my own routine to apply labels. This
tends
to
be smaller than Rob's without as much error handling, and is specific
to
the
particular solution I'm working on. Essentially it finds the range
based
on
whatever VBA or Name/Refers To definitions you use, and goes cell by
cell
to
apply the labels and if desired the formats.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"AK" wrote in message
...
Need the help up of the Excel gurus..

I'm using Rob Bovey's XY Chart labeler to label a Red, Yellow, and
Green
XY
chart.

By the way...this add-in is great!!!

The data for the charts are built from dynamic named ranges for both
X
and
Y. I have a helper column for the labels that is a dynamic named
range
as
well. All data is linked to an MS Access db.

Here's what I'm trying to do:
The data for the charts will change whenever I load the file with
new
data
and was wondering if anyone knew how to create a macro to call up
the
Add
In
and place the dynamic named range in the "... Label Range" field for
each
Red, Yellow, and Green data series.

I would then repeat this macro for each XY chart in the file.

Many many thanks in advance.

AK










Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Switch chart points ON/OFF help request joecrabtree Charts and Charting in Excel 1 November 23rd 07 04:44 PM
Label in Bar Chart Randy Charts and Charting in Excel 6 September 14th 07 01:12 PM
Label in XY chart zac2170 Charts and Charting in Excel 0 July 18th 06 11:31 AM
Add label on a chart hurriance Charts and Charting in Excel 2 June 30th 06 09:36 PM
Label on Bar Chart Sash Charts and Charting in Excel 1 August 30th 05 05:07 PM


All times are GMT +1. The time now is 06:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"