Can xy graph origin be control from a cell?

  • Thread starter Thread starter Jo
  • Start date Start date
J

Jo

Hi everyone,

Say you have xy graph with (0,0) as its origin. Of course you can make
the origin has any non-zero value by clicking the x axis and chaging
the value from 0 to, say, 5. Same thing to y axis by clicking on it.

If I have to make the origin value change frequently, is there a way
to do so from a cell?

Thanks,
Jo
 
Use the change event to detect the change in the cell and then do the VBA
equivalent to what you describe doing manually in your post.

Information on events
http://www.cpearson.com/excel/events.htm
and numerous posts in this newsgroup.
http://tinyurl.com/ypof8t for some examples

to get code on changing the axis, turn on the macro recorder while you do it
manually. Turn off the macro recorder and study the code recorded.
 
Use the change event to detect the change in the cell and then do the VBA
equivalent to what you describe doing manually in your post.

Information on eventshttp://www.cpearson.com/excel/events.htm
and numerous posts in this newsgroup.http://tinyurl.com/ypof8t for some examples

to get code on changing the axis, turn on the macro recorder while you do it
manually. Turn off the macro recorder and study the code recorded.

--
Regards,
Tom Ogilvy








- Show quoted text -

Tom,

Yes, but I guess I am missing something here. Say the origin was (0,0)
and want to change it to (2,5). When I click on either x or y axis, I
need to type that value which is 2 or 5.

So, if I am using macro, how would the macro record those new origin
values?

Thanks,
Mike
 
you said:
is there a way to do so from a cell?

so you would write the event code to trap the entry you make in a specific
cell or specific cells (1 for x, 1 for y) and use the values placed there to
update the graph using the code you recorded.
 
Back
Top