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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
| Private Sub CommandButton1_Click()
Dim dia As Integer
Dim ar As Integer
Dim ad As Single
Dim x As Single
Dim l As Single
Dim z As Single
Dim vc As Single
Dim nbreu As Integer
Dim rm As Integer
Dim total As Single
Dim var As Single
Dim vrotation As Single
Dim rapide As Single
Dim coeff As Single
Dim ddv As Single
Dim les As Single
Dim nd As Single
Dim avr As Single
Dim i As Integer
Dim j As Integer
For i = 1 To Application.Workbooks.Count
If Workbooks(i).Name = ActiveWorkbook.Name Then
nobook = i
Exit For
End If
Next
For j = 1 To ActiveWorkbook.Worksheets.Count
If ActiveWorkbook.ActiveSheet.Name = ActiveWorkbook.Worksheets(j).Name Then
nofeuille = j
Exit For
End If
Next
avr = Cells(8, 4).Value
x = Cells(9, 4).Value
z = Cells(10, 4).Value
rm = Cells(11, 4).Value
ddv = Cells(12, 4).Value
nbreu = Cells(14, 4).Value
les = Cells(15, 4).Value
l = Cells(16, 4).Value
dia = Cells(18, 4).Value
vc = Cells(19, 4).Value
vr = Cells(20, 4).Value
nd = Cells(21, 4).Value
ad = Cells(22, 4).Value
ar = Cells(23, 4).Value
coeff = Cells(25, 3).Value
If vr > rm Then
vr = rm
End If
usinage = ((l + (les * 2)) / ar) * (10 / 6)
rapide = ((2 * x) + (2 * z) + gu + l) / (avr * 1000) * (10 / 6)
var = usinage + rapide
total = total + var
total = total * nbreu * coeff
Workbooks(i).Sheets(j).Range("D26").Value = total
End Sub |
Partager