Interdire le copier coller

Bonjour,

J'aimerai interdire le copier coller de ma feuille de classeur... comment peut on faire?

Bonjour,

Il te suffit de protéger ta feuille en faisant OUTIL => PROTECTION => PROTEGER LA FEUILLE

Amicalement

Nad

ça n'interdit pas le copier coller ça, ça interdit juste le fait de modifier les feuilles du classeur....

souri84 a écrit :

ça n'interdit pas le copier coller ça, ça interdit juste le fait de modifier les feuilles du classeur....

Re,

Décoche le fait de pouvoir sélectionner les cellules... Pas de sélection possible = Pas de copier-coller ....

Nad

ok merci

Salut le forum

Un bout de code tirer du site Excelabo avec des ajouts.

Sub InterdireCopierCouper()
On Error Resume Next
With Application
'disables shortcut keys
.OnKey "^c", ""
.OnKey "^v", ""
.OnKey "^x", ""
'Disables Copy
.CommandBars("Edit").FindControl(ID:=19).Enabled = False
.CommandBars("Edit").FindControl(ID:=848).Enabled = False
.CommandBars("Cell").FindControl(ID:=19).Enabled = False
.CommandBars("Column").FindControl(ID:=19).Enabled = False
.CommandBars("Row").FindControl(ID:=19).Enabled = False
.CommandBars("Button").FindControl(ID:=19).Enabled = False
.CommandBars("Formula Bar").FindControl(ID:=19).Enabled = False
.CommandBars("Worksheet Menu Bar").FindControl(ID:=19).Enabled = False
.CommandBars("Standard").FindControl(ID:=19).Enabled = False
.CommandBars("Button").FindControl(ID:=848).Enabled = False
.CommandBars("Formula Bar").FindControl(ID:=848).Enabled = False
.CommandBars("Worksheet Menu Bar").FindControl(ID:=848).Enabled = False
.CommandBars("Standard").FindControl(ID:=848).Enabled = False
.CommandBars("Ply").FindControl(ID:=848).Enabled = False
'Disables Cut
.CommandBars("Edit").FindControl(ID:=21).Enabled = False
.CommandBars("Cell").FindControl(ID:=21).Enabled = False
.CommandBars("Column").FindControl(ID:=21).Enabled = False
.CommandBars("Row").FindControl(ID:=21).Enabled = False
.CommandBars("Button").FindControl(ID:=21).Enabled = False
.CommandBars("Formula Bar").FindControl(ID:=21).Enabled = False
.CommandBars("Worksheet Menu Bar").FindControl(ID:=21).Enabled = False
.CommandBars("Standard").FindControl(ID:=21).Enabled = False
'Disable Paste
.CommandBars("Edit").FindControl(ID:=22).Enabled = False
.CommandBars("Cell").FindControl(ID:=22).Enabled = False
.CommandBars("Column").FindControl(ID:=22).Enabled = False
.CommandBars("Row").FindControl(ID:=22).Enabled = False
.CommandBars("Button").FindControl(ID:=22).Enabled = False
.CommandBars("Formula Bar").FindControl(ID:=22).Enabled = False
.CommandBars("Worksheet Menu Bar").FindControl(ID:=22).Enabled = False
.CommandBars("Standard").FindControl(ID:=22).Enabled = False
'Disable PasteSpecial
.CommandBars("Edit").FindControl(ID:=755).Enabled = False
.CommandBars("Cell").FindControl(ID:=755).Enabled = False
.CommandBars("Column").FindControl(ID:=755).Enabled = False
.CommandBars("Row").FindControl(ID:=755).Enabled = False
.CommandBars("Button").FindControl(ID:=755).Enabled = False
.CommandBars("Formula Bar").FindControl(ID:=755).Enabled = False
.CommandBars("Worksheet Menu Bar").FindControl(ID:=755).Enabled = False
.CommandBars("Standard").FindControl(ID:=755).Enabled = False
End With
End Sub

Sub RetablirCopierCouper()
'Même code avec True au-lieu de False
End Sub

Et encore je ne suis pas sur que je n'en ai pas oublier......

Mytå

merci pour ce code... juste un petit problème, je le mets ou?

Mais merci bcp,

bonsoir,

Tu fais ALT+F1, tu insere un module et la tu colle le code

Salut,

Merci, mais quand je fais ALT + F1, ca me fait un graphique.

Donc j'ai ouvert Visual Basic, j'ai créé un nouveau module et j'ai collé le code, mais je peux toujours copier/coller....

Mais merci pour les modules, je ne connaissais pas ce truc....

Merci beaucoup pour ce code,

Ca marche !!!!

Oups, en fait j'avais voulu marquer ALT+F11 au lieu de ALT+F1

c'est pas grave, du moment que le code fonctionne....

merci encore,

Souri84

Salut le forum

Juste pour donner un complément d'information

Si tu veux empêcher le copier-coller à tous le classeur

Private Sub Workbook_BeforeClose(Cancel As Boolean)
  RetablirCopierCouper
End Sub

Private Sub Workbook_Open()
  InterdireCopierCouper
End Sub

Ou juste à une feuille en particulier

Private Sub Worksheet_Activate()
  InterdireCopierCouper
End Sub

Private Sub Worksheet_Deactivate()
  RetablirCopierCouper
End Sub

Mytå

Rechercher des sujets similaires à "interdire copier coller"