Sub FacturatioNvelle()
[J3].Select
RétabliMenu
Sheets("Dr House_Raissa").Visible = True
Sheets("Facture").Visible = True
[AF4].FormulaR1C1 = "08/08/2023"
'select lignes vides à partir de ligne 7 end(xldown)
Range("A7:L" & Range("A65536").End(xlUp).Row).SpecialCells(xlCellTypeVisible).Select
[AB4].FormulaR1C1 = "=COUNTA(R[4086]C[-27]:R[19996]C[-27])"
ActiveCell.Name = "MaCell" 'nomme la cellule
Selection.AutoFilter
[MaCell].Select: ActiveWindow.ScrollRow = Selection.Row
'formules en col ab-ae-bg
[MaCell].Select
Set CelDeb = ActiveCell.Offset(0, 27)
Range(CelDeb, CelDeb.End(xlDown)).FormulaR1C1 = "=IF(RC[-18]=""RdV Fait Facturé"",0,SUBSTITUTE(SUBSTITUTE(LEFT(RC[-17],10),"" "",""."",1),"" "",""."",1))"
Set CelDeb = ActiveCell.Offset(0, 31)
Range(CelDeb, CelDeb.End(xlDown)).FormulaR1C1 = "=IF(RC[-4]=0,"""",IF(R4C-RC[-4]>0,RC[-30]&"" - ""&RC[-31],""""))"
Set CelDeb = ActiveCell.Offset(0, 58)
Range(CelDeb, CelDeb.End(xlDown)).FormulaR1C1 = "=IF(RC[-27]<>"""",1,0)"
'copy valeurs dans facture
ActiveCell.Offset(0, 27).Resize(1, 32).Select: Selection.Copy
Range(ActiveCell.Offset(1, 0), ActiveCell.Offset(1000, 31)).PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range(ActiveCell.Offset(-1, 0), ActiveCell.Offset(1000, 31)).Copy
Sheets("Facture").Select
Range("C73").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Appels").Select
'col J
[MaCell].Select
Set CelDeb = ActiveCell.Offset(0, 9)
Range(CelDeb, CelDeb.End(xlDown)) = "RdV Fait Facturé"
Columns("AB:BG").ClearContents
Application.CutCopyMode = False
ActiveWindow.ScrollColumn = 6
Range("A1").Select
' copie RdV facturé dans Dr_House Raissa + contrôle nbr total de lignes
End Sub