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
|
End With
End Sub
Function TrouveType(V)
TrouveType = V
If IsDate(TrouveType) = True And InStr(TrouveType, "/") <> 0 And InStr(TrouveType, ":") <> 0 Then TrouveType = Format(TrouveType, "yyyy-mm-dd hh:mm"): Exit Function
If IsDate(TrouveType) = True And InStr(TrouveType, "/") <> 0 Then TrouveType = Format(TrouveType, "yyyy-mm-dd"): Exit Function
If IsNumeric(Replace(TrouveType, ".", ",")) = True Then TrouveType = Replace(TrouveType, ",", "."): Exit Function
End Function
Private Sub CmdModifier_Click()
Dim Ctrl As Control
Dim Colonne As Integer
Dim Ligne As Long
Dim I As Byte
If Me.CboDate.ListIndex = -1 Then Exit Sub
Ligne = Me.CboDate.ListIndex + 4
With Sheets("Data_Système")
For Each Ctrl In Me.Controls
Colonne = Val(Ctrl.Tag)
If Colonne > 0 Then
.Cells(Ligne, Colonne) = TrouveType(Ctrl)
End If
Next Ctrl
If InStr(1, Sheets("Fiche").Name, "Rdt_") <> 0 Then
.Cells(Ligne, 61) = TrouveType(Sheets("Fiche").Range("coût_Ha_C1") / Sheets("Fiche").Range("Rdt_C1"))
.Cells(Ligne, 62) = TrouveType(Sheets("Fiche").Range("coût_Ha_C2") / Sheets("Fiche").Range("Rdt_C2"))
.Cells(Ligne, 63) = TrouveType(Sheets("Fiche").Range("coût_Ha_C3") / Sheets("Fiche").Range("Rdt_C3"))
.Cells(Ligne, 64) = TrouveType(Sheets("Fiche").Range("coût_Ha_C4") / Sheets("Fiche").Range("Rdt_C4"))
.Cells(Ligne, 65) = TrouveType(Sheets("Fiche").Range("coût_Ha_C5") / Sheets("Fiche").Range("Rdt_C5"))
.Cells(Ligne, 66) = TrouveType(Sheets("Fiche").Range("coût_Ha_C6") / Sheets("Fiche").Range("Rdt_C6"))
.Cells(Ligne, 67) = TrouveType(Sheets("Fiche").Range("coût_Ha_C7") / Sheets("Fiche").Range("Rdt_C7"))
.Cells(Ligne, 68) = TrouveType(Sheets("Fiche").Range("coût_Ha_C8") / Sheets("Fiche").Range("Rdt_C8"))
.Cells(Ligne, 69) = TrouveType(Sheets("Fiche").Range("coût_Ha_C9") / Sheets("Fiche").Range("Rdt_C9"))
.Cells(Ligne, 70) = TrouveType(Sheets("Fiche").Range("coût_Ha_C10") / Sheets("Fiche").Range("Rdt_C10"))
End If
End With
Me.Hide
End Sub
Private Sub CmdAnnuler_Click()
Me.Hide
End Sub |
Partager