LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Chart making

I am making a report that is get its data from workbook. Now the report is
already made i.e. the charts and tables ar done but the input data is old.
Therefore I have a macro that searches the new info and (tries to) update the
charts and tables. I have a problem though with getting the charts to work.
The code works like this:
1) I specifiy certain headings to search for and stores the address of the
these cells. and then use these cells as point of reference to get the
indata. Code:

If index = 0 Then
varWorksheetInfoArray(0) = "Data"
varWorksheetInfoArray(1) = "Value"
varWorksheetInfoArray(2) = "Exchange rate"
varWorksheetInfoArray(3) = "Inflation"
end if
Call chartMaker1(varWorksheetInfoArray)

I then call a sub that is to replace to old values in the charts with the
new ones.

Private Sub chartMaker1(ByRef varWorksheetInfoArray() As Variant)
Dim i, j As Integer
Dim rng1, rng2, rng3, rng4 As Range

In here I look for the addresses that I need (all these things work..)
If IsEmpty(varWorksheetInfoArray(0)) = False Then
Set rng1 =
Worksheets(varWorksheetInfoArray(0)).Cells.Find(va rWorksheetInfoArray(1),
LookIn:=xlValues)
etc..

I then iterate my way through the data to get the correct range (that also
works). Neverthe i and j that are coming they work and specifies the
addresses that sets the range.

Now here comes my problem. I try to get new info to the charts by writing:

Sheets("Rapport").Select
ActiveSheet.ChartObjects("Diagram 2").Activate
With ActiveChart
.SeriesCollection(1).Values = Range(rng2.Offset(i, 0).Address & ":"
& rng2.Offset(j, 0).Address)
.SeriesCollection(2).Values = Range(rng3.Offset(i, 0).Address & ":"
& rng3.Offset(j, 0).Address)
.SeriesCollection(1).XValues =
Sheets(varWorksheetInfoArray(0)).Range(rng1.Offset (i, 0).Address,
rng1.Offset(j, 0).Address)
End With

and it just does not work. All addresses etc. ar correct, it is just the
syntax how to get the new info to the charts that is not working..Please I
would be very thankful if anyone oculd help me!! Thanks!
 
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
Making a chart jack Excel Discussion (Misc queries) 1 May 8th 07 01:30 PM
Making a chart How do i make a chart Charts and Charting in Excel 2 January 8th 07 01:54 PM
making a chart p-nut Excel Discussion (Misc queries) 1 November 15th 06 06:10 AM
Chart making Arun Bhadoria Charts and Charting in Excel 1 May 12th 05 06:05 PM
Making a chart Devin Charts and Charting in Excel 0 April 28th 05 12:50 AM


All times are GMT +1. The time now is 10:04 PM.

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

About Us

"It's about Microsoft Excel"