Thread: Lock view
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Lock view

Application.ScreenUpdating = False

'your code

Application.ScreenUpdating = True

But........doing away with all those extraneous "selects" would be better.

Sub dothings()
Columns("U:W").Clear
Columns("T:X").NumberFormat = "$#,##0.00"
Range("U1").Select
End Sub


Gord Dibben MS Excel MVP

On Thu, 11 Dec 2008 13:54:04 -0800, Ben in CA
wrote:

Hi,

In other programming environments, you can speed things up by not performing
formating and calculations "live".

For instance, if I run the following script:

Columns("U:U").Select
Selection.Clear
Range("T1").Select
Columns("V:V").Select
Selection.Clear
Range("T1").Select
Columns("W:W").Select
Selection.Clear
Columns("T:X").Select
Selection.NumberFormat = "$#,##0.00" ' Make Currencey format
Range("U1").Select ' Select a signal cell to avoid confusion

when a form button is pressed, the page flashes, etc. while it does the
changes.

In Excel, should the screen be "locked" and then "unlocked" before and after
the script? If so, how can this be done?

Thanks for any suggestions!

Ben