+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Forum Contributor
    Join Date
    05-13-2009
    Location
    London, England
    MS-Off Ver
    Excel XP
    Posts
    174

    macro to create line graphs

    Hello again folks,

    I'm trying to write a macro to make a line graph out of a set of data

    Workbook contains 2 sheets - "DV-IVSpread" with data, it has 3 tables, Table 1 contains data that is represented in the grid on the other sheet "HeatMap", and Table 3 contains the data that I need to display in a line graph (but it will be 1 column at a time, e.g. graph of '1mx1y', graph of '3mx1y', etc....)
    I will get back to this in a moment.

    Look at sheet"Heatmap", see the grid,
    '1mx1y' on Table 1 in "DV-IVSpread" is shown in the grid, with '1m' on the Y axis(vertical) and '1y' on the X-Axis(horizontal).
    '3mx10y' on Table 1 in "DV-IVSpread" is shown in the grid, with '3m' on Y axis and '10y' on X axis.

    So when i want to graph 1mx1y I need to click on the 1st square of the grid(cells C5:C7), and when I do that it makes a line graph for the data pertaining to 1mx1y on Table 3 (which has data for around 2 yrs). And I want that for all the 64 squares in the grid.

    This means I need 2 things:
    1. A code to make the line graph. There will only be one line graph displayed at a time (a small one abt half the size of grid), only a graph of the gridsquare that i select.
    2. I need to be able to click on these grid squares...how do I do that, text boxes are not working..I need something like a transparent square box on top of each gridsquare so that I can still see the numbers and the colour, but at the same time be able to click on it to initiate the macro.


    hope i was clear there

    please advise, thanks
    Attached Files Attached Files

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944

    Re: macro to create line graphs

    The code simple outputs the row/column of the shape that was clicked.
    From this information I build a data source to the chart.

    I used rectangles with no fill.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    05-13-2009
    Location
    London, England
    MS-Off Ver
    Excel XP
    Posts
    174

    Re: macro to create line graphs

    Andy, dude that was pretty got, i found another solution to that but this looks better.
    thanks a bunch man, I've posted another charting issue, it'd be great if you could take a look

    cheers

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.2.0