+ Reply to Thread
Results 1 to 2 of 2

Update graphs with Macro

  1. #1
    Registered User
    Join Date
    12-27-2005
    Posts
    5

    Update graphs with Macro

    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

  2. #2
    Tom Ogilvy
    Guest

    Re: 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" <Ferdinand.20pcva_1135693203.4635@excelforum-nospam.com> wrote
    in message news:Ferdinand.20pcva_1135693203.4635@excelforum-nospam.com...
    >
    > 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
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1