Bonjour
j'utilise cette macro pour colorier des cellules,mais lorsque je change de couleur les anciennes ne s'éffacent pas.
Que faudrait-il rajouter
macro:
Dim c As Range, cell As Range
Dim ws As Workseet
Set ws = Workseet("produits")
Set c = ws.Range("D3:J500")
Application.Screenupdating = False
c.Select
For Each cell In Selection
If cell.Value = ws.Range("C2").Value Then
cell.Interior.ColorIndex = 3
End If
If cell.Value = ws.Range("D2").Value Then
cell.Interior.ColorIndex = 6
End If
If cell.Value = ws.Range("E2").Value Then
cell.Interior.ColorIndex = 26
End If
If cell.Value = ws.Range("F2").Value Then
cell.Interior.ColorIndex = 4
End If
Next
ws.Range("I2").Select
Applicatin.ScreenUpdating = True
End Sub
Merci
j'utilise cette macro pour colorier des cellules,mais lorsque je change de couleur les anciennes ne s'éffacent pas.
Que faudrait-il rajouter
macro:
Dim c As Range, cell As Range
Dim ws As Workseet
Set ws = Workseet("produits")
Set c = ws.Range("D3:J500")
Application.Screenupdating = False
c.Select
For Each cell In Selection
If cell.Value = ws.Range("C2").Value Then
cell.Interior.ColorIndex = 3
End If
If cell.Value = ws.Range("D2").Value Then
cell.Interior.ColorIndex = 6
End If
If cell.Value = ws.Range("E2").Value Then
cell.Interior.ColorIndex = 26
End If
If cell.Value = ws.Range("F2").Value Then
cell.Interior.ColorIndex = 4
End If
Next
ws.Range("I2").Select
Applicatin.ScreenUpdating = True
End Sub
Merci