Lock view

  • Thread starter Thread starter Ben in CA
  • Start date Start date
B

Ben in CA

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
 
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
 
Thanks Gord - Works great, and that's a good suggestion about the
consolidation. (As you can tell, I'm rather new at this!)

Ben
 
Back
Top