appliquer EnableSelection = xlUnlockedCells à tous les onglets
2 réponses
Sunburn
Bonjour,
j'ai une macro pour protéger tous mes onglets. comment préciser, pour tous
les onglets "EnableSelection = xlUnlockedCells", et non pas pour l'onglet
actif ?
yann
-------
' Protection automatique de toutes les feuilles d'un classeur
Sub PROTEGERFEUILLES()
Dim nombre As Integer
nombre = ActiveWorkbook.Sheets.Count
Application.ScreenUpdating = False
For I = 1 To nombre
Worksheets(I).Protect , DrawingObjects:=True ', UserInterfaceOnly:=True
Active.Worksheets.EnableSelection = xlUnlockedCells
Next I
End Sub
---------
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
isabelle
bonjour Sunburn,
Sub PROTEGERFEUILLES() Dim nombre As Integer nombre = ActiveWorkbook.Sheets.Count Application.ScreenUpdating = False For I = 1 To nombre With Worksheets(I) .Protect , DrawingObjects:=True ', UserInterfaceOnly:=True .EnableSelection = xlUnlockedCells End With Next I End Sub
isabelle
Sunburn a écrit :
Bonjour, j'ai une macro pour protéger tous mes onglets. comment préciser, pour tous les onglets "EnableSelection = xlUnlockedCells", et non pas pour l'onglet actif ? yann ------- ' Protection automatique de toutes les feuilles d'un classeur Sub PROTEGERFEUILLES() Dim nombre As Integer nombre = ActiveWorkbook.Sheets.Count Application.ScreenUpdating = False For I = 1 To nombre Worksheets(I).Protect , DrawingObjects:=True ', UserInterfaceOnly:=True Active.Worksheets.EnableSelection = xlUnlockedCells Next I End Sub ---------
bonjour Sunburn,
Sub PROTEGERFEUILLES()
Dim nombre As Integer
nombre = ActiveWorkbook.Sheets.Count
Application.ScreenUpdating = False
For I = 1 To nombre
With Worksheets(I)
.Protect , DrawingObjects:=True ', UserInterfaceOnly:=True
.EnableSelection = xlUnlockedCells
End With
Next I
End Sub
isabelle
Sunburn a écrit :
Bonjour,
j'ai une macro pour protéger tous mes onglets. comment préciser, pour tous
les onglets "EnableSelection = xlUnlockedCells", et non pas pour l'onglet
actif ?
yann
-------
' Protection automatique de toutes les feuilles d'un classeur
Sub PROTEGERFEUILLES()
Dim nombre As Integer
nombre = ActiveWorkbook.Sheets.Count
Application.ScreenUpdating = False
For I = 1 To nombre
Worksheets(I).Protect , DrawingObjects:=True ', UserInterfaceOnly:=True
Active.Worksheets.EnableSelection = xlUnlockedCells
Next I
End Sub
---------
Sub PROTEGERFEUILLES() Dim nombre As Integer nombre = ActiveWorkbook.Sheets.Count Application.ScreenUpdating = False For I = 1 To nombre With Worksheets(I) .Protect , DrawingObjects:=True ', UserInterfaceOnly:=True .EnableSelection = xlUnlockedCells End With Next I End Sub
isabelle
Sunburn a écrit :
Bonjour, j'ai une macro pour protéger tous mes onglets. comment préciser, pour tous les onglets "EnableSelection = xlUnlockedCells", et non pas pour l'onglet actif ? yann ------- ' Protection automatique de toutes les feuilles d'un classeur Sub PROTEGERFEUILLES() Dim nombre As Integer nombre = ActiveWorkbook.Sheets.Count Application.ScreenUpdating = False For I = 1 To nombre Worksheets(I).Protect , DrawingObjects:=True ', UserInterfaceOnly:=True Active.Worksheets.EnableSelection = xlUnlockedCells Next I End Sub ---------
Sunburn
Merci isabelle, ça fonctionne. Par contre, il n'y a qu'un . Merci beaucoup. YANN
"isabelle" a écrit :
bonjour Sunburn,
Sub PROTEGERFEUILLES() Dim nombre As Integer nombre = ActiveWorkbook.Sheets.Count Application.ScreenUpdating = False For I = 1 To nombre With Worksheets(I) ..Protect , DrawingObjects:=True ', UserInterfaceOnly:=True ..EnableSelection = xlUnlockedCells End With Next I End Sub
isabelle
Sunburn a écrit : > Bonjour, > j'ai une macro pour protéger tous mes onglets. comment préciser, pour tous > les onglets "EnableSelection = xlUnlockedCells", et non pas pour l'onglet > actif ? > yann > ------- > ' Protection automatique de toutes les feuilles d'un classeur > Sub PROTEGERFEUILLES() > Dim nombre As Integer > nombre = ActiveWorkbook.Sheets.Count > Application.ScreenUpdating = False > For I = 1 To nombre > Worksheets(I).Protect , DrawingObjects:=True ', UserInterfaceOnly:=True > Active.Worksheets.EnableSelection = xlUnlockedCells > Next I > End Sub > ---------
Merci isabelle, ça fonctionne.
Par contre, il n'y a qu'un .
Merci beaucoup.
YANN
"isabelle" a écrit :
bonjour Sunburn,
Sub PROTEGERFEUILLES()
Dim nombre As Integer
nombre = ActiveWorkbook.Sheets.Count
Application.ScreenUpdating = False
For I = 1 To nombre
With Worksheets(I)
..Protect , DrawingObjects:=True ', UserInterfaceOnly:=True
..EnableSelection = xlUnlockedCells
End With
Next I
End Sub
isabelle
Sunburn a écrit :
> Bonjour,
> j'ai une macro pour protéger tous mes onglets. comment préciser, pour tous
> les onglets "EnableSelection = xlUnlockedCells", et non pas pour l'onglet
> actif ?
> yann
> -------
> ' Protection automatique de toutes les feuilles d'un classeur
> Sub PROTEGERFEUILLES()
> Dim nombre As Integer
> nombre = ActiveWorkbook.Sheets.Count
> Application.ScreenUpdating = False
> For I = 1 To nombre
> Worksheets(I).Protect , DrawingObjects:=True ', UserInterfaceOnly:=True
> Active.Worksheets.EnableSelection = xlUnlockedCells
> Next I
> End Sub
> ---------
Merci isabelle, ça fonctionne. Par contre, il n'y a qu'un . Merci beaucoup. YANN
"isabelle" a écrit :
bonjour Sunburn,
Sub PROTEGERFEUILLES() Dim nombre As Integer nombre = ActiveWorkbook.Sheets.Count Application.ScreenUpdating = False For I = 1 To nombre With Worksheets(I) ..Protect , DrawingObjects:=True ', UserInterfaceOnly:=True ..EnableSelection = xlUnlockedCells End With Next I End Sub
isabelle
Sunburn a écrit : > Bonjour, > j'ai une macro pour protéger tous mes onglets. comment préciser, pour tous > les onglets "EnableSelection = xlUnlockedCells", et non pas pour l'onglet > actif ? > yann > ------- > ' Protection automatique de toutes les feuilles d'un classeur > Sub PROTEGERFEUILLES() > Dim nombre As Integer > nombre = ActiveWorkbook.Sheets.Count > Application.ScreenUpdating = False > For I = 1 To nombre > Worksheets(I).Protect , DrawingObjects:=True ', UserInterfaceOnly:=True > Active.Worksheets.EnableSelection = xlUnlockedCells > Next I > End Sub > ---------