Screen Updating
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 -- Michael Mitchelson |
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 On Sun, 13 Mar 2005 20:49:03 -0800, "Michael" wrote: 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 |
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 "Gord Dibben" wrote: Michael Don't know if you have a typo or not, but proper syntax is.... Application.ScreenUpdating = False 'True Gord Dibben Excel MVP On Sun, 13 Mar 2005 20:49:03 -0800, "Michael" wrote: 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 |
All times are GMT +1. The time now is 09:07 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com