Re : protection d'une formule
Je me suis tromper dans le listing ...J,ai tellement essayer de différente facon....désolé
Voici le resultat:
Sub Archiver()
Dim nomfichier
Dim PO As String
Dim nom_client As String, num As String
With ThisWorkbook.ActiveSheet
.Copy
nom_client = .Range("B6")
num = .Range("P3")
PO = .Range("I12")
chemin = "C:\Facture\" 'repertoire d'archive
nomfichier = num & "_" & nom_client & "_" & PO & ".xls"
MsgBox "Votre sauvegarde porte la référence : " & nomfichier
With ActiveWorkbook
.SaveAs Filename:=chemin & nomfichier
.Close
End With
Sheets("Invoice").Range("P3") = Left(num, 1) & Right(num, Len(num) - 1) + 1
Sheets("Invoice 2").Range("P3") = Left(num, 1) & Right(num, Len(num) - 1) + 1
Sheets("Cash sale").Range("P3") = Left(num, 1) & Right(num, Len(num) - 1) + 1
End With
With ActiveSheet
Sheets("Invoice").Range("B6:I9,M6:Q6,D10:F10,B11:G11,O10😛10,M11😛11,I12:M12,C12:E13,D14:M15,A20:Q31").SpecialCells(xlCellTypeConstants, 23).ClearContents
Sheets("Invoice 2").Range("B6:I9,M6:Q6,D10:F10,B11:G11,O10😛10,M11😛11,I12:M12,C12:E13,D14:M15,A20:Q31").SpecialCells(xlCellTypeConstants, 23).ClearContents
Sheets("Cash sale").Range("B6:I9,M6:Q6,D10:F10,B11:G11,O10😛10, M11😛11,I12:M12,C12:E13,D14:M15,A20:Q31").SpecialCells(xlCellTypeConstants, 23).ClearContents
End With
ThisWorkbook.Save
End Sub
Il me donne une erreur sur la ligne en rouge
Merci de ta patience
Panda