![]() |
|
Forum
|
|
|
#1 (permalink) |
|
Guest
Messages: n/a
|
j'avais écrit 2 s/prog en vba pour proteger (et déprotéger) toutes les feuilles d'un classeur excel. Ca fonctionnait bien sous excel 97 et 2000 mais ça ne fonctionne plus sous excel 2003!!! Quel'un a-t-il un remède à mon problème. Merci d'avance
Public Sub Protection() réponse = InputBox("Entrer OUI ou NON", "Protection", "OUI") If réponse = "OUI" Then For Each w In Application.ActiveWorkbook.Sheets If w.Protect = False Then w.Protect End If Next End If End Sub Public Sub Déprotection() réponse = InputBox("Entrer OUI ou NON", "Déprotection", "OUI") If réponse = "OUI" Then For Each w In Application.ActiveWorkbook.Sheets If w.Protect = True Then w.Unprotect End If Next End If End Sub |
|
|
#2 (permalink) |
|
Guest
Messages: n/a
|
bonsoir Francois
je n'ai qu'Excel2002 pour faire des essais , mais tu déja peux tester cette adaptation Sub Protection() Dim Reponse As String Dim w As Worksheet Reponse = InputBox("Entrer OUI ou NON", "Protection", "OUI") If Reponse = "OUI" Then For Each w In ActiveWorkbook.Sheets w.Protect Next End If End Sub Sub Déprotection() Dim w As Worksheet Dim Reponse As String Reponse = InputBox("Entrer OUI ou NON", "Déprotection", "OUI") If Reponse = "OUI" Then For Each w In ActiveWorkbook.Sheets w.Unprotect Next End If End Sub bonne soiree MichelXld |
| ANNONCES | |
| Liens sociaux |
| Outils de la discussion | |
|
|