View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.charting
PBezucha PBezucha is offline
external usenet poster
 
Posts: 120
Default Data label doesn't match data point!

.... or automatize the second method proposed by Bernard with the following
macro:

Sub CurveToActiveSheet()
'Sub transfers the selected series from a chart that has been copied
'from another workbook/worksheet to the data source in the same position
'as they were in the original worksheet.
'PBezucha, 2007
Dim F As String, P1 As Long, P2 As Long, Ser As Variant
Set Ser = Selection
On Error GoTo ErrExit
F = Ser.Formula
P1 = InStrRev(F, ",", -1)
P2 = InStrRev(F, "'", P1)
If P2 = 0 Then P2 = InStrRev(F, "!", P1)
P1 = InStrRev(F, "'", P2 - 1)
If P1 = 0 Then P1 = InStrRev(F, ",", P2)
Ser.Formula = Replace(F, Mid(F, P1 + 1, P2 - P1 - 1), _
ActiveSheet.Name, 1, 3)
On Error GoTo 0
Exit Sub
ErrExit:
MsgBox "No chart series has been selected"
End Sub

Regards
--
Petr Bezucha


"kippers" wrote:

Hi,

I currently have a number of graphs (10-12) that I need to replicate (for
different data obviously) across 14 worksheets (approx 140-150 graphs in
total). I am copying the relevant worksheet into the different work books
and amending the source range, however, I have noticed that the data values
do not automatically update (even when the rest of the graph does). So I can
have a bar chart showing one figure and the data label saying another.

Does anyone know of updating the data values automatically i.e. to reflect
the data point that the data value is representing? If not, Ill have to go
through each graph individually which probably wont be feasible.

Any help much appreciated!

R