Excel VBA - .Value
Résolu/Fermé
A voir également:
- Excel VBA - .Value
- Liste déroulante excel - Guide
- Si et excel - Guide
- Aller à la ligne excel - Guide
- Word et excel gratuit - Guide
- Excel compter cellule couleur sans vba - Guide
1 réponse
OK c'est bon j'ai trouvé
Private Sub Worksheet_Change(ByVal Target As Range)
Dim num As Integer
Application.ScreenUpdating = False
Application.EnableEvents = False
ActiveSheet.Unprotect Password:="BE"
If Range("C4").Value = "R&D only" Then
Range("F11").Value = "N/A"
Range("B11:h11").Interior.Color = RGB(165, 165, 165)
Range("F11").Font.ColorIndex = 2
End If
If Range("C4").Value <> "R&D only" Then
If Range("F11").Value = "N/A" Then
Range("F11").Value = ""
Range("B11:e11").Interior.Color = RGB(219, 229, 241)
Range("f11:H11").Interior.Color = RGB(255, 255, 255)
End If
End If
ActiveSheet.Protect Password:="BE"
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim num As Integer
Application.ScreenUpdating = False
Application.EnableEvents = False
ActiveSheet.Unprotect Password:="BE"
If Range("C4").Value = "R&D only" Then
Range("F11").Value = "N/A"
Range("B11:h11").Interior.Color = RGB(165, 165, 165)
Range("F11").Font.ColorIndex = 2
End If
If Range("C4").Value <> "R&D only" Then
If Range("F11").Value = "N/A" Then
Range("F11").Value = ""
Range("B11:e11").Interior.Color = RGB(219, 229, 241)
Range("f11:H11").Interior.Color = RGB(255, 255, 255)
End If
End If
ActiveSheet.Protect Password:="BE"
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub