Bonjour,
J'ai un problème avec un code lorsque je vais de Exycel XP, dans lequel il a été écrit, vers le 2003.
Message d'erreur:
Incompatibilité de type - Errreur d'exécution 13
Le code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim RaBereich As Range, RaZelle As Range
Set RaBereich = Range("F5:AC65")
'Set RaBereich = Sh.Range("F5:AC65") 'UK
For Each RaZelle In Range(Target.Address)
'For Each RaZelle In Target 'UK
If Not Intersect(RaZelle, RaBereich) Is Nothing Then
Select Case UCase(RaZelle.Value)
Case "X"
RaZelle.Interior.ColorIndex = 37
RaZelle.Font.ColorIndex = 11
Case "/"
RaZelle.Interior.ColorIndex = 37
RaZelle.Font.ColorIndex = 11
Case "CP"
RaZelle.Interior.ColorIndex = 43
RaZelle.Font.ColorIndex = 0
Case Else
RaZelle.Interior.ColorIndex = xlNone
RaZelle.Font.ColorIndex = 0
End Select
End If
Next RaZelle
Set RaBereich = Nothing
End Sub
Il bloque à la ligne:
Select Case UCase(RaZelle.Value)
Qui a une idée de ce qu'il faudrait modifier dans le code?
Merci d'avance
Aloha
J'ai un problème avec un code lorsque je vais de Exycel XP, dans lequel il a été écrit, vers le 2003.
Message d'erreur:
Incompatibilité de type - Errreur d'exécution 13
Le code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim RaBereich As Range, RaZelle As Range
Set RaBereich = Range("F5:AC65")
'Set RaBereich = Sh.Range("F5:AC65") 'UK
For Each RaZelle In Range(Target.Address)
'For Each RaZelle In Target 'UK
If Not Intersect(RaZelle, RaBereich) Is Nothing Then
Select Case UCase(RaZelle.Value)
Case "X"
RaZelle.Interior.ColorIndex = 37
RaZelle.Font.ColorIndex = 11
Case "/"
RaZelle.Interior.ColorIndex = 37
RaZelle.Font.ColorIndex = 11
Case "CP"
RaZelle.Interior.ColorIndex = 43
RaZelle.Font.ColorIndex = 0
Case Else
RaZelle.Interior.ColorIndex = xlNone
RaZelle.Font.ColorIndex = 0
End Select
End If
Next RaZelle
Set RaBereich = Nothing
End Sub
Il bloque à la ligne:
Select Case UCase(RaZelle.Value)
Qui a une idée de ce qu'il faudrait modifier dans le code?
Merci d'avance
Aloha