Bonjour, j'execute une function toute simple avec un if mais celle-ci ne marche pas. le s retourné étant toujours = 0
Public Function createl()
Dim s As Integer
s = 0
For j = 2 To Workbooks("test").Worksheets("parametre").Range("B1").Value
nom = Workbooks("test").Worksheets("journalier").Range("A" & j).Value
chemintel = "C:\prive\Stats\sauvegarde\" & nom
Workbooks.Open (chemintel)
For i = 2 To 2000
Workbooks(nom).Worksheets(nom).Range("C" & i).Activate
MsgBox (ActiveCell.Value)
If Cells(i, 3).Value = "Telephone" Then
s = s + 1
End If
Next i
ActiveWorkbook.Close
MsgBox (s)
Next j
End Function
s reste = 0 alors que l'activecellvalue me retourne pourtant bien des msgbox avec le mot Telephone.
Merci pour vos réponses,
Cordialement,
Briet Mickaël
Public Function createl()
Dim s As Integer
s = 0
For j = 2 To Workbooks("test").Worksheets("parametre").Range("B1").Value
nom = Workbooks("test").Worksheets("journalier").Range("A" & j).Value
chemintel = "C:\prive\Stats\sauvegarde\" & nom
Workbooks.Open (chemintel)
For i = 2 To 2000
Workbooks(nom).Worksheets(nom).Range("C" & i).Activate
MsgBox (ActiveCell.Value)
If Cells(i, 3).Value = "Telephone" Then
s = s + 1
End If
Next i
ActiveWorkbook.Close
MsgBox (s)
Next j
End Function
s reste = 0 alors que l'activecellvalue me retourne pourtant bien des msgbox avec le mot Telephone.
Merci pour vos réponses,
Cordialement,
Briet Mickaël