ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to program a macro that moves my chart as I scroll through myspreadsheet. (https://www.excelbanter.com/excel-programming/414625-how-program-macro-moves-my-chart-i-scroll-through-myspreadsheet.html)

R Tanner

How to program a macro that moves my chart as I scroll through myspreadsheet.
 
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

Libby

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

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.
"R Tanner" wrote:

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



All times are GMT +1. The time now is 06:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com