Screen Updating

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All
I have struck a situation that hasn't happened before.
I have a Macro running to Lock all Sheets in my workbook, (16 sheets in
total).
The Macro works fine except for screen updating.
I have put Screen Updating=False at the beginning of the macro &
Screen Updating = True at the end, but no matter what I try it still updates
the screens on the fly. Whilst this is not a major issue, I am using an old
Laptop and this really slows things down.
The syntax is Ok as it was typed in lower case and accepted by VB.
I have used this hundreds of times in the past with no problems.
Any advice would be appreciated

Regards
Michael
 
Hi Michael,

If by locking you mean protecting, this simple macro does it in the
active workbook without needing to turn off screen updating -

Sub LockSheets()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Protect
Next ws
End Sub

Are you selecting each sheet? You don't need to. I hope this helps,

Gary
 
Michael

Don't know if you have a typo or not, but proper syntax is....

Application.ScreenUpdating = False 'True


Gord Dibben Excel MVP
 
Thanks Guys
As always a great response.
Gord......yeah just a typo, don't what has caused the problem, but I have
taken the easy way out and adopted Garys suggestion and used his code.
Mine was going through sheet by sheet, so was going to be naturally slower.
Just what I need on an old Think Pad.

Regards
Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top