How to program a macro that moves my chart as I scroll through myspreadsheet.

R

R Tanner

I have a very large spreadsheet. In this spreadsheet, I have a series
of indicators. I have a small macro that bases the chart values off
of my current selection. What I would like to do is program my chart
to move as I scroll. So as I scroll down the spreadsheet, the chart
moves with my current view. Does anyone know how to do this?

Thanks
 
L

Libby

Hi R Tanner,

I haven't worked out how to do it if you scroll, but this might get you by
until a more knowledgeable person posts something.

If you're using Excel 2003 then you'll have 65536 rows
The Top property of a chart varies from 0 to 840000 for rows 1 to 0
Thus each row = a top property of the row*12.8

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Sheet1.ChartObjects("Chart 1").Top = ActiveCell.Row * 12.8
End Sub

This will reposition the chart to the area of the active cell.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top