Bonjour le forum
Voila j'ai un code qui verifie les postes dans un fichier ce code marche trés bien sous excel 2003 mais bug "erreur d'exécution"au niveau de "With ActiveSheet" sous excel 2010
Voici le code
Merci de votre aide
Sub VerifPoste()
Dim Nom As String, Poste As String
Dim Lg As Integer, Col As Integer, cel As Variant, l As Variant, c As Variant
With ActiveSheet
For Each cel In Range("A2:A65536").SpecialCells(xlCellTypeConstants)
Nom = cel.Value
Poste = Range("D" & cel.Row).Value
Lg = cel.Row
Set l = Range("L:L").Find(Nom, LookIn:=xlValues, lookat:=xlWhole)
Set c = Range("2:2").Find(Poste, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing And Not l Is Nothing Then
Col = c.Column
If Not Cells(l.Row, c.Column) <> "" Then
cel.Interior.ColorIndex = 38
Else
cel.Interior.ColorIndex = xlNone
End If
End If
Next
End With
End Sub
Voila j'ai un code qui verifie les postes dans un fichier ce code marche trés bien sous excel 2003 mais bug "erreur d'exécution"au niveau de "With ActiveSheet" sous excel 2010
Voici le code
Merci de votre aide
Sub VerifPoste()
Dim Nom As String, Poste As String
Dim Lg As Integer, Col As Integer, cel As Variant, l As Variant, c As Variant
With ActiveSheet
For Each cel In Range("A2:A65536").SpecialCells(xlCellTypeConstants)
Nom = cel.Value
Poste = Range("D" & cel.Row).Value
Lg = cel.Row
Set l = Range("L:L").Find(Nom, LookIn:=xlValues, lookat:=xlWhole)
Set c = Range("2:2").Find(Poste, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing And Not l Is Nothing Then
Col = c.Column
If Not Cells(l.Row, c.Column) <> "" Then
cel.Interior.ColorIndex = 38
Else
cel.Interior.ColorIndex = xlNone
End If
End If
Next
End With
End Sub