LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Update graphs with Macro

to find the last filled column

Dim col as Long, rng as Range
col = cells(3,"IV").End(xltoLeft).column

set rng = cells(3,col).offset(0,-9).Resize(10,1)

now use rng to set your source data in your code.

Another approach would be to use a defined name that is established with a
formula in the ReferstoRange. this is essentially the same approach with
the formula finding the lastfilled cell in the row, then offset back -9
cells and resizing to a range of 10 columns. Then you set the source range
for the graph to this defined name.

--
Regards,
Tom Ogilvy

"Ferdinand" wrote
in message ...

Hi,

I would like some help with macro's .... I have a data-file wich is
filled on a weekly / daily basis. Out of this data a graph is made
(let's say On Time Delivery for a carrier). How can I make a Macro to
get excel to make a graph out of the latest ten columns/rows filled
with data?

Let's say that today's selcteion ("source data" would be A3:J3 ... how
can i make a macro that will take B3:K3 the next time and C3:L3
thereafter etc. etc.

I have a macro made myself to update a graph via "source dat" .. my
question is .. how can I make this macro more intelligent?

Thanks for your help


--
Ferdinand
------------------------------------------------------------------------
Ferdinand's Profile:

http://www.excelforum.com/member.php...o&userid=29921
View this thread: http://www.excelforum.com/showthread...hreadid=496158



 
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
update graphs automatically either from same book or a new spreads Helenf Excel Discussion (Misc queries) 1 August 4th 09 02:50 PM
How do I set up formulas to update graphs dynamically [email protected] Charts and Charting in Excel 5 August 5th 08 06:56 PM
Automatically update graphs ChrisG Charts and Charting in Excel 25 February 12th 07 05:29 PM
excel graphs won't update ejfu Charts and Charting in Excel 0 July 6th 06 11:18 PM
Graphs in Other Files do not Update Dolphinv4 Excel Discussion (Misc queries) 0 October 21st 05 10:38 AM


All times are GMT +1. The time now is 11:44 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"