Wrox Programmer Forums
|
BOOK: Excel 2000/2002 VBA Programmer's Reference
This is the forum to discuss the Wrox book Excel 2000 VBA: Programmers Reference by John Green, Stephen Bullen, Felipe Martins, Brian Johnson; ISBN: 9780764544019
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Excel 2000/2002 VBA Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 12th, 2005, 02:25 PM
Registered User
 
Join Date: Feb 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Updating the Chart range in a loop

I wrote code to create an embedded chart in EXCEL 2003 using the example given in page 181 of EXCEL 2002 VBA . I changed the way the source data is given to be given using a range name:
 .SetSourceData Source:=Sheets("Sheet1").Range("DataTT"), PlotBy _
                                                             :=xlColumns

First, I initialize the graph. Later I have I loop where I get in every itration new data that are added to the range name:

  With Range("DataTT")
         .Resize(.Rows.Count + 1).Name = "DataTT"
    End With
    With Cht
    .SetSourceData Source:=Sheets("Sheet1").Range("DataTT"), PlotBy _
                                                         :=xlColumns
   End With

I expect that the chart is actualized automatically in each iteration of the loop, but it does not happen in that way. The chart is actualized until the end of the loop where all the data points are added togeter. I nees a chart that shows in real time how each new datum is added.
May anybody tell me what I am missing?
Regards,
Elim







 
Old April 18th, 2006, 02:23 AM
Registered User
 
Join Date: Apr 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
In order to make the update data appear in the screen you can put this code inside the iteration:

Application.ScreenUpdating = true

But the effect is that your program will become slower and blinking (since it need to update the screen)








Similar Threads
Thread Thread Starter Forum Replies Last Post
How to loop through a range? chobo XSLT 3 May 24th, 2008 03:50 PM
DetailsView "Out of range" error when updating rsearing ASP.NET 2.0 Basics 16 August 17th, 2007 07:38 AM
Getting chart range help munkiller Excel VBA 1 June 24th, 2005 05:37 AM
Using Customized chart for Pivot Chart kliu9 Excel VBA 3 October 13th, 2004 09:37 AM
Excel VBA: Select range of data and plot chart? xitu Excel VBA 1 December 23rd, 2003 04:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.