ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   EnableSelection for all sheets (https://www.excelbanter.com/excel-programming/382532-enableselection-all-sheets.html)

Newbeetle

EnableSelection for all sheets
 
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
--
This post was created using recycled electrons!

Don Guillett

EnableSelection for all sheets
 
Use a looping macro

--
Don Guillett
SalesAid Software

"Newbeetle" wrote in message
...
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
--
This post was created using recycled electrons!




Chip Pearson

EnableSelection for all sheets
 
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)


"Newbeetle" wrote in message
...
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
--
This post was created using recycled electrons!





All times are GMT +1. The time now is 08:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com