LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Worksheet_Calculate event and input data

I'm new in VBA and my question might sound silly.
I've got a worksheet with 2 charts. The user inputs data .... some
computations ... and the data is plotted in 2 chartobjects. Both charts
have to have the same Y maximum scale. After the data is introduced,
the user should change a dataSeries in one chart (by mouse click and
drag) and the Y axis might change. Therefore I've triggered a Calculate
event to identify the change, recompute the new values in "chart 7" and
set the axis in "chart 7" equal to Y axis in "chart 2". (See code
below).

Private Sub Worksheet_Calculate()
ActiveSheet.ChartObjects("Chart 7").Activate
ActiveChart.Axes(xlValue).Select

With ActiveChart.Axes(xlValue)
.MaximumScale = ChartObjects("Chart
2").Chart.Axes(xlValue).MaximumScale
End With

End Sub

Everything works OK if the input data has already been introduced. If
the user decide to change the input data, the cursor in the worksheet
jumps all the time to the Y axis in "chart 7" as it is the active
object. How can I activate the next cell in the worksheet object,
without knowing if the user pushed RETURN or ARROW LEFT, ARROW RIGHT,
etc. There should be a very simple work around solution but I could not
find it.

Thx,
-horatiu-

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using excel to manage event - ANY input deeply appreciated! :-) ojbelboe Excel Discussion (Misc queries) 3 January 18th 06 10:21 PM
Worksheet_Calculate event problem Otto Moehrbach[_6_] Excel Programming 2 October 28th 04 10:41 PM
A procedure should run when one cell switch between false/true - but not with worksheet_calculate or change event... Gunnar Johansson Excel Programming 3 October 19th 04 05:24 PM
Input Box Cancel Event Craig[_20_] Excel Programming 3 September 7th 04 10:21 AM
dynamically changing chart y axis using spin buttons and worksheet_calculate event jimnwilson Excel Programming 2 July 10th 04 04:24 AM


All times are GMT +1. The time now is 04:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"