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

HI all ,

OK ... help here please ... you know when you write a visual basic programme
in Excel , and you want to take some information from "Sheet1" and do some
calculations with it and put it into "Sheet2" for example .. but you want to
do this calculation thousnads of times ... well what you see when you run it
is Excel flicking from Sheet1 to Sheet2 all the time ... is there any way of
turning that off ... like turning off that ... if you know what I mean ...
because it must slow the programme down having to display each sheet every
time ..

I am looking for a command like "AutoUpdate Off " does that exist ??

Thanks



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Visual Basic

Use:
Application.screenupdating=false



Francisco Mariscal
fcomariscal at hotmail dot com


-----Original Message-----
HI all ,

OK ... help here please ... you know when you write a

visual basic programme
in Excel , and you want to take some information

from "Sheet1" and do some
calculations with it and put it into "Sheet2" for

example .. but you want to
do this calculation thousnads of times ... well what you

see when you run it
is Excel flicking from Sheet1 to Sheet2 all the time ...

is there any way of
turning that off ... like turning off that ... if you

know what I mean ...
because it must slow the programme down having to display

each sheet every
time ..

I am looking for a command like "AutoUpdate Off " does

that exist ??

Thanks



.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Visual Basic

yep you can turn off the updating

put the following at the beginning of your code

Application.ScreenUpdating = False
there is no need to set it to true as this is done automatically when macro
finishes.

you may also want to use the following if your spreadsheets contain lots of
formulas

application.Calculation = xlCalculationManual
this stops excel recalculating formulas each time it changes something -
however you do need to set this back to automatic at the end of the macro

application.Calculation = xlCalculationAutomatic


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Visual Basic

Hi Adrian,
Turning off screen updating (and calculation) will make a
tremendous difference. The fact that you have a lot of
screen refreshing though probably indicates that you are
changing the selection and or activecell.

Code produced by the macro recorder does not generally
produce efficient code. It usually changes the selections
and refers to specific cells. Use the recorded macro as
an aid for what instructions can be used, and look up
those instructions in VBE Help..

Once the new sheet is created is possible to refer to any
cell on either sheet without changing the sheet or the
cell selection.
http://www.mvps.org/dmcritchie/excel/code/bus_sched.txt

Some hints on better coding can be found in
Slow Response and Memory Problems
http://www.mvps.org/dmcritchie/excel/slowresp;.htm
and in
Proper, and other Text changes -- Use of SpecialCells
http://www.mvps.org/dmcritchie/excel/proper.htm

and in Charles William's site
Decision Models - Excel Pages - Calculation Secrets, Downloads and Tips
http://www.decisionmodels.com/optspeed.htm



--
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Bob Phillips" wrote in message ...
Adrian,

There sure is. Precede your code with

Application.Screenupdating = False

and set it to True on exit.

--

HTH

Bob Phillips

"Adrian Tucker" wrote in message
...
HI all ,

OK ... help here please ... you know when you write a visual basic

programme
in Excel , and you want to take some information from "Sheet1" and do some
calculations with it and put it into "Sheet2" for example .. but you want

to
do this calculation thousnads of times ... well what you see when you run

it
is Excel flicking from Sheet1 to Sheet2 all the time ... is there any way

of
turning that off ... like turning off that ... if you know what I mean ...
because it must slow the programme down having to display each sheet every
time ..

I am looking for a command like "AutoUpdate Off " does that exist ??

Thanks







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
Is Visual Basic the same as Visual Studio 2008? Mike Stewart Excel Worksheet Functions 5 January 11th 09 04:58 PM
In visual basic Chuck Excel Worksheet Functions 5 December 30th 07 03:08 PM
visual basic Matthew Excel Discussion (Misc queries) 4 October 10th 07 01:28 PM
Visual Basic Co-op 20 Excel Discussion (Misc queries) 2 June 28th 07 09:06 PM
changing the visual basic in office 2003 to visual studio net bigdaddy3 Excel Discussion (Misc queries) 1 September 13th 05 10:57 AM


All times are GMT +1. The time now is 02:51 PM.

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

About Us

"It's about Microsoft Excel"