#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Lock view

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Lock view

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

Ben

"Gord Dibben" wrote:

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



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
stop view and lock columns Psychokitten Excel Worksheet Functions 2 February 8th 10 09:05 PM
Password to Lock out VBA from View Seanie Excel Programming 3 October 25th 08 01:08 AM
hide tabs from view then lock tabs? slowboat Excel Discussion (Misc queries) 1 December 19th 07 07:06 AM
Lock Screen to current view Chris Excel Programming 1 January 28th 05 10:00 AM
How to lock the view of certain number of rows sameerce[_12_] Excel Programming 1 May 20th 04 12:00 PM


All times are GMT +1. The time now is 09:05 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"