Bonjour,
J'ai écris une macro en vba pas très compliquée, qui marchait bien avant que je ne rajoute la fonction CountIf... Maintenant j'ai un message d'erreur 1004 à chaque fois. Je ne trouve pas mon erreur...
Voici mon code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim i As Integer
Dim Lne As Integer
For i = 3 To 60
If Worksheets("DUREE_JOUR").Range("A" & i).Value = "Total général" Then
Lne = i - 1
End If
Next i
Worksheets("MOY.DUREE_JOUR").Range("B1").Value = WorksheetFunction.CountIf(Worksheets("DUREE_JOUR").Range(Range("B4"), Range("B" & Lne)), "<>0")
End Sub
Si quelqu'un pouvait m'aider! Merci beaucoup!
J'ai écris une macro en vba pas très compliquée, qui marchait bien avant que je ne rajoute la fonction CountIf... Maintenant j'ai un message d'erreur 1004 à chaque fois. Je ne trouve pas mon erreur...
Voici mon code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim i As Integer
Dim Lne As Integer
For i = 3 To 60
If Worksheets("DUREE_JOUR").Range("A" & i).Value = "Total général" Then
Lne = i - 1
End If
Next i
Worksheets("MOY.DUREE_JOUR").Range("B1").Value = WorksheetFunction.CountIf(Worksheets("DUREE_JOUR").Range(Range("B4"), Range("B" & Lne)), "<>0")
End Sub
Si quelqu'un pouvait m'aider! Merci beaucoup!