XL 2016 CHERCHE FORMULE VBA

mcj1997

XLDnaute Accro
Bonjour,

Fichier en PJ avec problématique pour remplacer une colonne de formule par une formule en VBA ?

Ceci afin d'éviter l'effacement des formules avec la fonction copier / coller et si je mets une protection le copier / coller devient impossible.

Merci d'avance,
 

Pièces jointes

  • CHERCHE FORMULE VBA.xlsx
    54 KB · Affichages: 39

DoubleZero

XLDnaute Barbatruc
Bonjour, mcj1997, le Forum,

Comme ceci ?
Code:
Option Explicit

Sub Formules_rétablir()
    With Application: .ScreenUpdating = False: .Calculation = xlManual: .EnableEvents = False: End With
    Sheets("S34").Activate
    Range("B1").FormulaR1C1 = "=COUNTIF(R[2]C:R[599]C,""<>"")"    '
    Range("V1").FormulaR1C1 = "=SUBTOTAL(9,R[2]C:R[349]C)"
    Range("W1").FormulaR1C1 = "=SUBTOTAL(9,R[2]C:R[349]C)"
    Range("X1").FormulaR1C1 = "=SUBTOTAL(2,R[2]C:R[349]C)"
    Range("Y1").FormulaR1C1 = "=SUBTOTAL(9,R[2]C:R[349]C)"
    Range("Z1").FormulaR1C1 = "=SUBTOTAL(9,R[2]C:R[349]C)"
    Range("AA1").FormulaR1C1 = "=SUBTOTAL(9,R[2]C:R[349]C)"
    Range("Y3:Y" & Cells(Rows.Count, 24).End(xlUp).Row).FormulaR1C1 = "=IF(RC[-1]="""",(""""),RC[-1]-RC[-19])"
    Range("Y3").FormulaR1C1 = "=IF(RC[-1]="""",(""""),RC[-1]-RC[-19])"
    With Application: .EnableEvents = True: .Calculation = xlAutomatic: .ScreenUpdating = True: End With
End Sub
A bientôt :)
 

Statistiques des forums

Discussions
312 361
Messages
2 087 625
Membres
103 608
dernier inscrit
rawane