bizarre, bizarre
sur une feuille protégee par un mot de passe, avec un filtre automatique
je fais à l'ouverture du classeur
Feuil4.EnableAutoFilter = True
Feuil4.Protect Contents:=True, UserInterfaceOnly:=True
bon, le filtre est actif, et la feuille protégée Mais si je lance une macro de tri (macro faite avec l'enregistreur) , la macro, non
seulement s'exécute, mais déprotége ma feuille ?????
--
Pierre CFI
MVP Microsoft Access
Mail : http://cerbermail.com/?z0SN8cN53B
Site pour bien commencer
http://users.skynet.be/mpfa/
Site perso
http://access.cfi.free.fr
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
Pierre CFI [mvp]
suite donc sur une feuille protégée, méme sans mettre le filtre automatique avec Sub Macro1() ' ' Macro1 Macro ' Macro enregistrée le 29/11/2003 par Pierre SALAUN ' ActiveSheet.EnableAutoFilter = True ActiveSheet.Cells(1, ActiveCell.Column).Select Selection.Sort Key1:¬tiveSheet.Cells(1, ActiveCell.Column), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect Contents:=True, UserInterfaceOnly:=True
End Sub on peut trier, mais je viens peut etre de reinventer le vin chaud :o)) et jps que j'ai pas lu depuis longtemps me le dira
-- Pierre CFI MVP Microsoft Access Mail : http://cerbermail.com/?z0SN8cN53B
Site pour bien commencer http://users.skynet.be/mpfa/ Site perso http://access.cfi.free.fr "Pierre CFI [mvp]" a écrit dans le message de news:
Bonjour
bizarre, bizarre sur une feuille protégee par un mot de passe, avec un filtre automatique je fais à l'ouverture du classeur Feuil4.EnableAutoFilter = True Feuil4.Protect Contents:=True, UserInterfaceOnly:=True bon, le filtre est actif, et la feuille protégée Mais si je lance une macro de tri (macro faite avec l'enregistreur) , la macro, non
seulement s'exécute, mais déprotége ma feuille ?????
-- Pierre CFI MVP Microsoft Access Mail : http://cerbermail.com/?z0SN8cN53B
Site pour bien commencer http://users.skynet.be/mpfa/ Site perso http://access.cfi.free.fr
suite
donc sur une feuille protégée, méme sans mettre le filtre automatique avec
Sub Macro1()
'
' Macro1 Macro
' Macro enregistrée le 29/11/2003 par Pierre SALAUN
'
ActiveSheet.EnableAutoFilter = True
ActiveSheet.Cells(1, ActiveCell.Column).Select
Selection.Sort Key1:¬tiveSheet.Cells(1, ActiveCell.Column), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
ActiveSheet.Protect Contents:=True, UserInterfaceOnly:=True
End Sub
on peut trier, mais je viens peut etre de reinventer le vin chaud :o))
et jps que j'ai pas lu depuis longtemps me le dira
--
Pierre CFI
MVP Microsoft Access
Mail : http://cerbermail.com/?z0SN8cN53B
Site pour bien commencer
http://users.skynet.be/mpfa/
Site perso
http://access.cfi.free.fr
"Pierre CFI [mvp]" <XXX_pierresalaun@aol.com> a écrit dans le message de news: uHGEmIltDHA.2520@TK2MSFTNGP10.phx.gbl...
Bonjour
bizarre, bizarre
sur une feuille protégee par un mot de passe, avec un filtre automatique
je fais à l'ouverture du classeur
Feuil4.EnableAutoFilter = True
Feuil4.Protect Contents:=True, UserInterfaceOnly:=True
bon, le filtre est actif, et la feuille protégée Mais si je lance une macro de tri (macro faite avec l'enregistreur) , la macro,
non
seulement s'exécute, mais déprotége ma feuille ?????
--
Pierre CFI
MVP Microsoft Access
Mail : http://cerbermail.com/?z0SN8cN53B
Site pour bien commencer
http://users.skynet.be/mpfa/
Site perso
http://access.cfi.free.fr
suite donc sur une feuille protégée, méme sans mettre le filtre automatique avec Sub Macro1() ' ' Macro1 Macro ' Macro enregistrée le 29/11/2003 par Pierre SALAUN ' ActiveSheet.EnableAutoFilter = True ActiveSheet.Cells(1, ActiveCell.Column).Select Selection.Sort Key1:¬tiveSheet.Cells(1, ActiveCell.Column), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect Contents:=True, UserInterfaceOnly:=True
End Sub on peut trier, mais je viens peut etre de reinventer le vin chaud :o)) et jps que j'ai pas lu depuis longtemps me le dira
-- Pierre CFI MVP Microsoft Access Mail : http://cerbermail.com/?z0SN8cN53B
Site pour bien commencer http://users.skynet.be/mpfa/ Site perso http://access.cfi.free.fr "Pierre CFI [mvp]" a écrit dans le message de news:
Bonjour
bizarre, bizarre sur une feuille protégee par un mot de passe, avec un filtre automatique je fais à l'ouverture du classeur Feuil4.EnableAutoFilter = True Feuil4.Protect Contents:=True, UserInterfaceOnly:=True bon, le filtre est actif, et la feuille protégée Mais si je lance une macro de tri (macro faite avec l'enregistreur) , la macro, non
seulement s'exécute, mais déprotége ma feuille ?????
-- Pierre CFI MVP Microsoft Access Mail : http://cerbermail.com/?z0SN8cN53B
Site pour bien commencer http://users.skynet.be/mpfa/ Site perso http://access.cfi.free.fr
Pierre CFI [mvp]
bon, je continue mon numéro en affectant ces macros à des boutons persos, on peut trier ou filtrer une feuille protégée
Sub FiltreAuto() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.AutoFilter Else Selection.AutoFilter End If End Sub Sub TriCroissant() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True Else R.Select Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom End If
End Sub
Sub TriDécroissant() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True Else R.Select Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom End If End Sub
-- Pierre CFI
bon, je continue mon numéro
en affectant ces macros à des boutons persos, on peut trier ou filtrer une feuille protégée
Sub FiltreAuto()
Dim R As Range
Set R = ActiveSheet.Cells(1, ActiveCell.Column)
If ActiveSheet.ProtectContents Then
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
R.Select
Selection.AutoFilter
Else
Selection.AutoFilter
End If
End Sub
Sub TriCroissant()
Dim R As Range
Set R = ActiveSheet.Cells(1, ActiveCell.Column)
If ActiveSheet.ProtectContents Then
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
R.Select
Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
Else
R.Select
Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
End If
End Sub
Sub TriDécroissant()
Dim R As Range
Set R = ActiveSheet.Cells(1, ActiveCell.Column)
If ActiveSheet.ProtectContents Then
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
R.Select
Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
Else
R.Select
Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
End If
End Sub
bon, je continue mon numéro en affectant ces macros à des boutons persos, on peut trier ou filtrer une feuille protégée
Sub FiltreAuto() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.AutoFilter Else Selection.AutoFilter End If End Sub Sub TriCroissant() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True Else R.Select Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom End If
End Sub
Sub TriDécroissant() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True Else R.Select Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom End If End Sub
-- Pierre CFI
FxM
Bonjour Pierre,
Idée bête que je préfère donc dire moi-même ;o) - déprotéger - trier - reprotéger
@+ FxM
Pierre CFI [mvp] wrote:
bon, je continue mon numéro en affectant ces macros à des boutons persos, on peut trier ou filtrer une feuille protégée
Sub FiltreAuto() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.AutoFilter Else Selection.AutoFilter End If End Sub Sub TriCroissant() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True Else R.Select Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom End If
End Sub
Sub TriDécroissant() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True Else R.Select Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom End If End Sub
-- Pierre CFI
Bonjour Pierre,
Idée bête que je préfère donc dire moi-même ;o)
- déprotéger
- trier
- reprotéger
@+
FxM
Pierre CFI [mvp] wrote:
bon, je continue mon numéro
en affectant ces macros à des boutons persos, on peut trier ou filtrer une feuille protégée
Sub FiltreAuto()
Dim R As Range
Set R = ActiveSheet.Cells(1, ActiveCell.Column)
If ActiveSheet.ProtectContents Then
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
R.Select
Selection.AutoFilter
Else
Selection.AutoFilter
End If
End Sub
Sub TriCroissant()
Dim R As Range
Set R = ActiveSheet.Cells(1, ActiveCell.Column)
If ActiveSheet.ProtectContents Then
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
R.Select
Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
Else
R.Select
Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
End If
End Sub
Sub TriDécroissant()
Dim R As Range
Set R = ActiveSheet.Cells(1, ActiveCell.Column)
If ActiveSheet.ProtectContents Then
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
R.Select
Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
Else
R.Select
Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
End If
End Sub
Idée bête que je préfère donc dire moi-même ;o) - déprotéger - trier - reprotéger
@+ FxM
Pierre CFI [mvp] wrote:
bon, je continue mon numéro en affectant ces macros à des boutons persos, on peut trier ou filtrer une feuille protégée
Sub FiltreAuto() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.AutoFilter Else Selection.AutoFilter End If End Sub Sub TriCroissant() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True Else R.Select Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom End If
End Sub
Sub TriDécroissant() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True Else R.Select Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom End If End Sub
-- Pierre CFI
Pierre CFI [mvp]
.../... bien sur, mais ici l'utilisateur ne connait pas le mot dz passe (et ne vient pas ici pour qu'on lui donne)
-- Pierre CFI MVP Microsoft Access Mail : http://cerbermail.com/?z0SN8cN53B
Site pour bien commencer http://users.skynet.be/mpfa/ Site perso http://access.cfi.free.fr "FxM" a écrit dans le message de news:
Bonjour Pierre,
Idée bête que je préfère donc dire moi-même ;o) - déprotéger - trier - reprotéger
@+ FxM
Pierre CFI [mvp] wrote:
bon, je continue mon numéro en affectant ces macros à des boutons persos, on peut trier ou filtrer une feuille protégée
Sub FiltreAuto() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.AutoFilter Else Selection.AutoFilter End If End Sub Sub TriCroissant() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True Else R.Select Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom End If
End Sub
Sub TriDécroissant() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True Else R.Select Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom End If End Sub
-- Pierre CFI
.../...
bien sur, mais ici l'utilisateur ne connait pas le mot dz passe (et ne vient pas ici pour qu'on lui donne)
--
Pierre CFI
MVP Microsoft Access
Mail : http://cerbermail.com/?z0SN8cN53B
Site pour bien commencer
http://users.skynet.be/mpfa/
Site perso
http://access.cfi.free.fr
"FxM" <fxmanceaux@chello.fr> a écrit dans le message de news: O9n6wIntDHA.3496@TK2MSFTNGP11.phx.gbl...
Bonjour Pierre,
Idée bête que je préfère donc dire moi-même ;o)
- déprotéger
- trier
- reprotéger
@+
FxM
Pierre CFI [mvp] wrote:
bon, je continue mon numéro
en affectant ces macros à des boutons persos, on peut trier ou filtrer une feuille protégée
Sub FiltreAuto()
Dim R As Range
Set R = ActiveSheet.Cells(1, ActiveCell.Column)
If ActiveSheet.ProtectContents Then
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
R.Select
Selection.AutoFilter
Else
Selection.AutoFilter
End If
End Sub
Sub TriCroissant()
Dim R As Range
Set R = ActiveSheet.Cells(1, ActiveCell.Column)
If ActiveSheet.ProtectContents Then
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
R.Select
Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
Else
R.Select
Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
End If
End Sub
Sub TriDécroissant()
Dim R As Range
Set R = ActiveSheet.Cells(1, ActiveCell.Column)
If ActiveSheet.ProtectContents Then
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
R.Select
Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
Else
R.Select
Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
End If
End Sub
.../... bien sur, mais ici l'utilisateur ne connait pas le mot dz passe (et ne vient pas ici pour qu'on lui donne)
-- Pierre CFI MVP Microsoft Access Mail : http://cerbermail.com/?z0SN8cN53B
Site pour bien commencer http://users.skynet.be/mpfa/ Site perso http://access.cfi.free.fr "FxM" a écrit dans le message de news:
Bonjour Pierre,
Idée bête que je préfère donc dire moi-même ;o) - déprotéger - trier - reprotéger
@+ FxM
Pierre CFI [mvp] wrote:
bon, je continue mon numéro en affectant ces macros à des boutons persos, on peut trier ou filtrer une feuille protégée
Sub FiltreAuto() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.AutoFilter Else Selection.AutoFilter End If End Sub Sub TriCroissant() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True Else R.Select Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom End If
End Sub
Sub TriDécroissant() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True Else R.Select Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom End If End Sub
-- Pierre CFI
FxM
J'ai bien fait de la poser moi-même ;o)
@+ FxM
Pierre CFI [mvp] wrote:
.../... bien sur, mais ici l'utilisateur ne connait pas le mot dz passe (et ne vient pas ici pour qu'on lui donne)
-- Pierre CFI MVP Microsoft Access Mail : http://cerbermail.com/?z0SN8cN53B
Site pour bien commencer http://users.skynet.be/mpfa/ Site perso http://access.cfi.free.fr "FxM" a écrit dans le message de news:
Bonjour Pierre,
Idée bête que je préfère donc dire moi-même ;o) - déprotéger - trier - reprotéger
@+ FxM
Pierre CFI [mvp] wrote:
bon, je continue mon numéro en affectant ces macros à des boutons persos, on peut trier ou filtrer une feuille protégée
Sub FiltreAuto() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.AutoFilter Else Selection.AutoFilter End If End Sub Sub TriCroissant() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True Else R.Select Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom End If
End Sub
Sub TriDécroissant() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True Else R.Select Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom End If End Sub
-- Pierre CFI
J'ai bien fait de la poser moi-même ;o)
@+
FxM
Pierre CFI [mvp] wrote:
.../...
bien sur, mais ici l'utilisateur ne connait pas le mot dz passe (et ne vient pas ici pour qu'on lui donne)
--
Pierre CFI
MVP Microsoft Access
Mail : http://cerbermail.com/?z0SN8cN53B
Site pour bien commencer
http://users.skynet.be/mpfa/
Site perso
http://access.cfi.free.fr
"FxM" <fxmanceaux@chello.fr> a écrit dans le message de news: O9n6wIntDHA.3496@TK2MSFTNGP11.phx.gbl...
Bonjour Pierre,
Idée bête que je préfère donc dire moi-même ;o)
- déprotéger
- trier
- reprotéger
@+
FxM
Pierre CFI [mvp] wrote:
bon, je continue mon numéro
en affectant ces macros à des boutons persos, on peut trier ou filtrer une feuille protégée
Sub FiltreAuto()
Dim R As Range
Set R = ActiveSheet.Cells(1, ActiveCell.Column)
If ActiveSheet.ProtectContents Then
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
R.Select
Selection.AutoFilter
Else
Selection.AutoFilter
End If
End Sub
Sub TriCroissant()
Dim R As Range
Set R = ActiveSheet.Cells(1, ActiveCell.Column)
If ActiveSheet.ProtectContents Then
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
R.Select
Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
Else
R.Select
Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
End If
End Sub
Sub TriDécroissant()
Dim R As Range
Set R = ActiveSheet.Cells(1, ActiveCell.Column)
If ActiveSheet.ProtectContents Then
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
R.Select
Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True
Else
R.Select
Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom
End If
End Sub
.../... bien sur, mais ici l'utilisateur ne connait pas le mot dz passe (et ne vient pas ici pour qu'on lui donne)
-- Pierre CFI MVP Microsoft Access Mail : http://cerbermail.com/?z0SN8cN53B
Site pour bien commencer http://users.skynet.be/mpfa/ Site perso http://access.cfi.free.fr "FxM" a écrit dans le message de news:
Bonjour Pierre,
Idée bête que je préfère donc dire moi-même ;o) - déprotéger - trier - reprotéger
@+ FxM
Pierre CFI [mvp] wrote:
bon, je continue mon numéro en affectant ces macros à des boutons persos, on peut trier ou filtrer une feuille protégée
Sub FiltreAuto() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.AutoFilter Else Selection.AutoFilter End If End Sub Sub TriCroissant() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True Else R.Select Selection.Sort Key1:=R, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom End If
End Sub
Sub TriDécroissant() Dim R As Range Set R = ActiveSheet.Cells(1, ActiveCell.Column) If ActiveSheet.ProtectContents Then ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True R.Select Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom ActiveSheet.Protect contents:=True, UserInterfaceOnly:=True Else R.Select Selection.Sort Key1:=R, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom End If End Sub