Sub Facturation()
'Macro par Dan & Nad pour Belette - XL pratique le 02/04/08
Dim extension As String
Dim numfac As Integer
Application.ScreenUpdating = False
numfac = ThisWorkbook.Sheets("Recapfacture").Range("B65536").End(xlUp).[COLOR="Red"]Row[/COLOR]
Range("c4") = Date
Range("b5") = "FACTURE N° " & Format(Now(), "yyyy") & "/"
Range("c5") = numfac + 1
extension = ".xls"
chemin = "C:\test2\facture\"
nomfichier = ActiveSheet.Range("b7") & Format(Now(), "-mmmm" & "-yyyy") & "-F" & Format(ActiveSheet.Range("c5"), "0000") & "-" & extension
MsgBox "Votre Facture est créé"
With ActiveWorkbook
.ActiveSheet.Name = "Facture"
.SaveAs Filename:=chemin & nomfichier
With ActiveSheet.Shapes(4)
.Select
Selection.Font.ColorIndex = 15
.OnAction = ""
End With
With ActiveSheet.Shapes(2)
.Select
.OnAction = "Recapfacture"
With ActiveWindow
.ScrollRow = 5
.ScrollColumn = 1
End With
Range("b7").Select
End With
Call RecapFacture
End With
End Sub