Dynamic "Crosses At"

K

KENNY

Trying to allow a scatter graph to have both axes flex to
a cell reference. Below is my non-working code.

Help?! TIA!


Option Explicit
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Select Case Target.Address

Case "$a$1"
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory)
_
.CrossesAt = Target.Value

Case "$b$1"
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlValue) _
.CrossesAt = Target.Value

Case Else
End Select
End Sub
 
J

Jon Peltier

Kenny -

Capitalize your address references: use "$A$1", not "$a$1". The rest of
the statement works fine.

- Jon
 

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