Bonjour
j'esssaye de compiler mon code et il me dise erreru definie par l'application
cependant je ne comprend pas le probleme si quelqu'un peut m'aider merci
Sub Class_Pepito()
Dim FL1, FLZ1, FLZ2, FLZ3 As Worksheet, NoCol As Integer
Dim NoLig, NoLigZ1, NoLigZ2, NoLigZ3, NoLig1 As Long, Var As Variant
Set FL1 = Worksheets(1)
Set FLZ1 = Worksheets(2)
Set FLZ2 = Worksheets(3)
Set FLZ3 = Worksheets(4)
NoLigZ1 = 1
NoLigZ2 = 1
NoLigZ3 = 1
NoCol = 1 'lecture de la colonne 1
For NoLig = 2 To Split(FL1.UsedRange.Address, "$")(4)
If FL1.Cells(NoLig, NoCol) = 1 Then
FLZ1.Rows(NoLigZ1).Value = FL1.Rows(NoLig).Value
NoLigZ1 = NoLigZ1 + 1
End If
If FL1.Cells(NoLig, NoCol) = 2 Then
FLZ2.Rows(NoLigZ2).Value = FL1.Rows(NoLig).Value
NoLigZ2 = NoLigZ2 + 1
End If
If FL1.Cells(NoLig, NoCol) = 3 Then
FLZ3.Rows(NoLigZ3).Value = FL1.Rows(NoLig).Value
NoLigZ3 = NoLigZ3 + 1
End If
For NoLig1 = 1 To Split(FL1.UsedRange.Address, "$")(4)
FL1.Cells(NoLig + 7, 10).Value = WorksheetFunction.Sum(FL1.Range(FL1.Cells(NoLig, 7), FL1.Cells(NoLig + 7, 7))) / 8
FL1.Cells(NoLig + 7, 11).Value = WorksheetFunction.Sum(FL1.Range(FL1.Cells(NoLig, 8), FL1.Cells(NoLig + 7, 8))) / 8
FL1.Cells(NoLig + 7, 12).Value = WorksheetFunction.Sum(FL1.Range(FL1.Cells(NoLig, 9), FL1.Cells(NoLig + 7, 9))) / 8
NoLig = NoLig + 8
FLZ1.Cells(NoLigZ1, 5).Value = WorksheetFunction.Average(FLZ1.Range(FLZ1.Cells(NoLigZ1, 7), 7))
Next
Next
'FeuilleZone1
'Moyenne
FLZ1.Cell(NoLigZ1, 3).Value = "Moyenne"
FLZ1.Cell(NoLigZ1, 7).Value = "moy de col g"
FLZ1.Cell(NoLigZ1, 8).Value = "moy de col h"
FLZ1.Cell(NoLigZ1, 9).Value = "moy de col i"
'ecart-type
FLZ1.Cell(NoLigZ1 + 1, 3).Value = "ecart-type"
FLZ1.Cell(NoLigZ1 + 1, 7).Value = "et de col g"
FLZ1.Cell(NoLigZ1 + 1, 8).Value = "et de col h"
FLZ1.Cell(NoLigZ1 + 1, 9).Value = "et de col i"
'variance
FLZ1.Cell(NoLigZ1 + 2, 3).Value = "variance"
FLZ1.Cell(NoLigZ1 + 2, 7).Value = "var de col g"
FLZ1.Cell(NoLigZ1 + 2, 8).Value = "var de col h"
FLZ1.Cell(NoLigZ1 + 2, 9).Value = "var de col i"
MsgBox "Ligne " & NoLig & vbNewLine & "Col " & NoCol
Set FL1 = Nothing
End Sub
la ligne ou j'obtiens cela est
FLZ1.Cells(NoLigZ1, 5).Value = WorksheetFunction.Average(FLZ1.Range(FLZ1.Cells(NoLigZ1, 7), 7))
Merci de m'aider