how do i make a chart follow the active cell

  • Thread starter Thread starter mepetey
  • Start date Start date
M

mepetey

I have a worksheet that has frozen panes. I need the chart that is on the
worksheet to be visible wherever the cursor is. is this possible?
 
Hi,

That would require VBA code. This example places the chart to the right
of the active cell.
Add this to the sheet code module which contains the chart object.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

With Target.Parent.ChartObjects(1)
.Top = Target.Cells(1).Top
.Left = Target.Cells(1).Left + Target.Cells(1).Width
End With

End Sub

Cheers
Andy
 
Thanks!

Andy Pope said:
Hi,

That would require VBA code. This example places the chart to the right of
the active cell.
Add this to the sheet code module which contains the chart object.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

With Target.Parent.ChartObjects(1)
.Top = Target.Cells(1).Top
.Left = Target.Cells(1).Left + Target.Cells(1).Width
End With

End Sub

Cheers
Andy
 

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

Back
Top