1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| Sub Nbsujet()
Dim n As Long
Dim alpha As Single
Dim frac As Single
Dim frac1 As Single
Dim npas As Single
Dim Address As String
alpha = Worksheets(1).Range("I19").Value
frac = (Int(Round(alpha, 2) * 10)) / 10
frac1 = Round(alpha, 2) - frac
npas = Worksheets(1).Range("F11").Value
If npas <> 0.1 And npas <> 0.05 Then
Call MsgBox("Le pas doit être de 0,1 ou 0,05", vbCritical Or vbOKOnly)
Exit Sub
End If
If npas = 0.1 Then pas = 6 Else pas = 14
With Worksheets(2).Range("a5:a44")
Set c = .Find(frac, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Worksheets(4).Range("A5").Value = Address |