Suppression des #DIV/0

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

Claude5

XLDnaute Occasionnel
Bonjour,

dans mon fichier je me retrouve avec les #DIV/0. Pour les supprimer j'utilise le filtre mais comment les supprimer par une seule opération. J'ai essayé aussi Remplacer par vide mais sans succès.

Merci à vous. Claude
 

Pièces jointes

Re : Suppression des #DIV/0

Bonjour JHA. En fait je dois l'inclure dans ma macro mais où? Peut être ActiveCell.FormulaR1C1 = "=+(RC[-1]/RC[-2])-1", à transformer en ActiveCell.FormulaR1C1 = "=SIERREUR((RC[-1]/RC[-2])-1" le + avant (RC remplacer par SIERREUR((

Windows("DEADLINES_SUMMARY V2.xlsx").Activate
Columns("G:G").Select
Selection.Insert Shift:=xlToRight
Columns("I:I").Select
Selection.Insert Shift:=xlToRight
Columns("L:L").Select
Selection.Insert Shift:=xlToRight
Columns("N:N").Select
Selection.Insert Shift:=xlToRight
ActiveWindow.SmallScroll ToRight:=5
Columns("Q:Q").Select
Selection.Insert Shift:=xlToRight
ActiveWindow.LargeScroll ToRight:=-1
Range("G2").Select
ActiveCell.FormulaR1C1 = "=+(RC[-1]/RC[-2])-1"
Range("G2").Select
Selection.Style = "Percent"
Selection.NumberFormat = "0.0%"
Selection.NumberFormat = "0.00%"
Selection.AutoFill Destination:=Range("G2:G382"), Type:=xlFillDefault
Range("G2:G382").Select
ActiveWindow.ScrollRow = 1
Range("I2").Select
ActiveCell.FormulaR1C1 = "=+(RC[-1]/RC[-4])-1"
Range("I2").Select
Selection.Style = "Percent"
Selection.NumberFormat = "0.0%"
Selection.NumberFormat = "0.00%"
Selection.AutoFill Destination:=Range("I2:I382"), Type:=xlFillDefault
Range("I2:I382").Select
Range("L2").Select
ActiveCell.FormulaR1C1 = "=+(RC[-1]/RC[-2])-1"
Range("L2").Select
Selection.Style = "Percent"
Selection.NumberFormat = "0.0%"
Selection.NumberFormat = "0.00%"
Selection.AutoFill Destination:=Range("L2:L383"), Type:=xlFillDefault
Range("L2:L383").Select
Range("A1").Select
ActiveWindow.SmallScroll ToRight:=5
Range("N2").Select
ActiveCell.FormulaR1C1 = "=+(RC[-1]/RC[-4])-1"
Range("N2").Select
Selection.Style = "Percent"
Selection.NumberFormat = "0.0%"
Selection.NumberFormat = "0.00%"
Selection.AutoFill Destination:=Range("N2:N383"), Type:=xlFillDefault
Range("N2:N383").Select
Range("A1").Select
ActiveWindow.SmallScroll ToRight:=9
Range("Q2").Select
ActiveCell.FormulaR1C1 = "=+(RC[-1]/RC[-2])-1"
Range("Q2").Select
Selection.Style = "Percent"
Selection.NumberFormat = "0.0%"
Selection.NumberFormat = "0.00%"
Selection.AutoFill Destination:=Range("Q2:Q383"), Type:=xlFillDefault
Range("Q2:Q383").Select
Range("A1").Select
ActiveWindow.SmallScroll ToRight:=9
Range("S2").Select
ActiveCell.FormulaR1C1 = "=+(RC[-1]/RC[-4])-1"
Range("S2").Select
Selection.Style = "Percent"
Selection.NumberFormat = "0.0%"
Selection.NumberFormat = "0.00%"
Selection.AutoFill Destination:=Range("S2:S383"), Type:=xlFillDefault
Range("S2:S383").Select
Cells.Select
With Selection.Font
.Name = "Arial"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Cells.EntireColumn.AutoFit
ActiveWorkbook.Save

End Sub
 
Re : Suppression des #DIV/0

bonjour à tous,

salut mutzik !

ça ne serait pas plutôt comme ceci:
ActiveCell.FormulaR1C1 = "=IFERROR((RC[-1]/RC[-2])-1,"""")"
ou selon
ActiveCell.FormulaR1C1 = "=IFERROR((RC[-1]/RC[-2])-1,"" "")"

EDIT: @claude5:
et avec ceci sur ta feuille, tu ne m'as pas répondu !?
dans les colonnes tu mets, exp en C2
=SI(A2=0;"";+(B2/A2)-1)

et tu tires vers le bas ceci à chaque colonne !

à moins que tu ne veuilles qu'en vb !?
 
Dernière édition:
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
12
Affichages
329
Réponses
15
Affichages
545
W
Retour