Bonjour, j'ai actuellement une macro qui me permet de supprimer certaines couleurs lors de l'impression.
Voici la macro:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Application.EnableEvents = False
Dim temp1(), temp2()
For Each c In ActiveSheet.UsedRange
If c.Interior.ColorIndex = 16 Then
n = n + 1
ReDim Preserve temp1(1 To n)
ReDim Preserve temp2(1 To n)
temp1(n) = c.Address
temp2(n) = c.Interior.ColorIndex
c.Interior.ColorIndex = xlNone
End If
Next c
ActiveSheet.PrintOut ' ou ActiveSheet.Printpreview
Cancel = True
For i = 1 To n
Range(temp1(i)).Interior.ColorIndex = temp2(i)
Next i
Application.EnableEvents = True
End Sub
Elle me permet de supprimer une certaine nuance de gris que j'ai choisi. Cette macro fonctionne très bien sur Excel 2007 mais impossible de la faire fonctionner sur excel 2017. Savez vous pourquoi?
Merci d'avance
Cordialement