Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default screen updating


I am running a simulation which creates a graph (covers almost the whole
sheet) on my Excel sheet. Also, there are some numbers on the bottom of
the sheet, which change as the simulation runs. I would like to see the
simulation running on the graph and the numbers changing on the bottom,
but now the view moves to the point where the results are recorded. Is
there any way to "lock" the view so that I can see the graph changing
while the simulation runs? Here is the code that I have created.

Sub Simulation()
'
Range("RESULTS").Select
Selection.ClearContents

For counter = 1 To Range("ITERATIONS")
Range("NPV").Select
Calculate
Cells(counter + 3, 16).Value = ActiveCell.Value
Next counter


End Sub


--
miikka1978
------------------------------------------------------------------------
miikka1978's Profile: http://www.excelforum.com/member.php...o&userid=32294
View this thread: http://www.excelforum.com/showthread...hreadid=554442

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default screen updating

On Thu, 22 Jun 2006 02:45:35 -0500, miikka1978 wrote:

[...]

Replace:

Range("RESULTS").Select
Selection.ClearContents


with:

Range("RESULTS").ClearContents

and replace:

[...]
Range("NPV").Select
Calculate
Cells(counter + 3, 16).Value = ActiveCell.Value

[...]

with:

Calculate
Cells(counter + 3, 16).Value = Range("NPV").Value

This won't affect the Selection object so this is probably what you want.

--
PL
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default screen updating


Thanks a lot!


Miikka


--
miikka1978
------------------------------------------------------------------------
miikka1978's Profile: http://www.excelforum.com/member.php...o&userid=32294
View this thread: http://www.excelforum.com/showthread...hreadid=554442

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default screen updating

Hi
You need to stop the axes on the graph rescaling.
Right click the x and y axes on the graph, choose format axes... and
click on the scale tab. Unclick the Auto boxes and set your scale
values as required.
I would also suggest in your code that you put in a DoEvents. This will
make your graphics change more smoothly, and let it respond to a button
click (to stop the animation for example).

For counter = 1 To Range("ITERATIONS")
Range("NPV").Select
Calculate
Cells(counter + 3, 16).Value = ActiveCell.Value
DoEvents
Next counter

and you can simplify your code to

For counter = 1 To Range("ITERATIONS")
Calculate
Cells(counter + 3, 16).Value = Range("NPV").Value
DoEvents
Next counter

you may also be able to leave out the Calculate bit. Try it.

regards
Paul


miikka1978 wrote:
I am running a simulation which creates a graph (covers almost the whole
sheet) on my Excel sheet. Also, there are some numbers on the bottom of
the sheet, which change as the simulation runs. I would like to see the
simulation running on the graph and the numbers changing on the bottom,
but now the view moves to the point where the results are recorded. Is
there any way to "lock" the view so that I can see the graph changing
while the simulation runs? Here is the code that I have created.

Sub Simulation()
'
Range("RESULTS").Select
Selection.ClearContents

For counter = 1 To Range("ITERATIONS")
Range("NPV").Select
Calculate
Cells(counter + 3, 16).Value = ActiveCell.Value
Next counter


End Sub


--
miikka1978
------------------------------------------------------------------------
miikka1978's Profile: http://www.excelforum.com/member.php...o&userid=32294
View this thread: http://www.excelforum.com/showthread...hreadid=554442


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default screen updating

Hi
Just reread your mail and I'm answering a whole other problem. Sorry
about that!
Paul

wrote:
Hi
You need to stop the axes on the graph rescaling.
Right click the x and y axes on the graph, choose format axes... and
click on the scale tab. Unclick the Auto boxes and set your scale
values as required.
I would also suggest in your code that you put in a DoEvents. This will
make your graphics change more smoothly, and let it respond to a button
click (to stop the animation for example).

For counter = 1 To Range("ITERATIONS")
Range("NPV").Select
Calculate
Cells(counter + 3, 16).Value = ActiveCell.Value
DoEvents
Next counter

and you can simplify your code to

For counter = 1 To Range("ITERATIONS")
Calculate
Cells(counter + 3, 16).Value = Range("NPV").Value
DoEvents
Next counter

you may also be able to leave out the Calculate bit. Try it.

regards
Paul


miikka1978 wrote:
I am running a simulation which creates a graph (covers almost the whole
sheet) on my Excel sheet. Also, there are some numbers on the bottom of
the sheet, which change as the simulation runs. I would like to see the
simulation running on the graph and the numbers changing on the bottom,
but now the view moves to the point where the results are recorded. Is
there any way to "lock" the view so that I can see the graph changing
while the simulation runs? Here is the code that I have created.

Sub Simulation()
'
Range("RESULTS").Select
Selection.ClearContents

For counter = 1 To Range("ITERATIONS")
Range("NPV").Select
Calculate
Cells(counter + 3, 16).Value = ActiveCell.Value
Next counter


End Sub


--
miikka1978
------------------------------------------------------------------------
miikka1978's Profile:
http://www.excelforum.com/member.php...o&userid=32294
View this thread: http://www.excelforum.com/showthread...hreadid=554442




Reply
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
Screen Updating nidovan Excel Programming 0 January 16th 05 09:24 PM
Screen Updating KG[_4_] Excel Programming 0 January 16th 05 07:12 PM
Screen Updating KG[_4_] Excel Programming 0 January 16th 05 05:09 PM
Screen updating Keith[_11_] Excel Programming 2 June 2nd 04 01:10 PM
Screen updating Stratuser Excel Programming 0 April 16th 04 05:20 PM


All times are GMT +1. The time now is 12:27 AM.

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"