EnableSelection for all sheets

G

Guest

Hi,

Can I amend the code below so that it applies to all worksheets without the
need to list each sheet name?

Sub Workbook_Open()
Sheets("Sheet1").EnableSelection = xlUnlockedCells
End Sub
 
C

Chip Pearson

Try

Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
WS.EnableSelection = xlUnlockedCells
Next WS


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)
 

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

Top