ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Assigning new values to charts (https://www.excelbanter.com/excel-programming/367541-assigning-new-values-charts.html)

freddie mac

Assigning new values to charts
 

Hello! I have previously posted questions in this field but I have neve
gotten an answer. I really really need help with this. I have neve
programmed before and now I am supposed to do this VBA application fo
Excel. What I want to do is simple enough but I have troubl
implementing it and since and really do not know anything abou
programming I do not know what is wrong. The problem is that I a
supposed to replace the existing series for a chart with new series.
have the new series but when applying them to a new chart it does no
work if I have not manually erased the old chart series. This does no
seem like an obstacle but this code have to work for othe
applications. I try to change the series in a loop. Code:

Do While k < (UBound(rng))
If Not IsEmpty(rng(k)) Then
ActiveChart.SeriesCollection(k).Values
Sheets(varWorksheetInfoArray(0)).Range(rng(k).Offs et(i, 0).Address
":" & rng(k).Offset(j, 0).Address)
Else: End If
k = k + 1
Loop
The find function returns the correct range so that is not a problem
The problem is that if the chart already has a series the new data doe
not apply to the chart. I have tried referring to the number instead o
the name of the series but with no success. Is there anything that yo
should do with the chart (this is the first time I am using xl/vba)
Should you try to delete the series or something. Please if you kno
anything about this help me out. If you see that the code is correc
then let me know. I know I have posted questions about this before bu
I really must get this to work and I have not gotten a proper answer.
have never programmed before and now I am stuck until midnight every da
since I have to do this outside of my other things. I know that it jus
a line or something that is missing but I have no clue where/what o
how to figure it out. Please I am begging all you out there if you kno
anything about this help me out. I have vistited e.g. the Meth
Consulting page where there are tips for dynamically chart making bu
that does not apply here. Please again any help is truly appreciated

--
freddie ma
-----------------------------------------------------------------------
freddie mac's Profile: http://www.excelforum.com/member.php...fo&userid=3610
View this thread: http://www.excelforum.com/showthread.php?threadid=56243



All times are GMT +1. The time now is 05:17 AM.

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