Private Sub BtnValidationDossier_Click()
Dim Lug As Long, K As Long, Col As Long, N As Integer, Lg As Integer, LstItem As ListItem, log, Op, E
ListView2.ListItems(1).Selected = False
Set ListView2.SelectedItem = Nothing
E = ListView2.ListItems.Count
For E = 1 To E
If ListView2.ListItems(E).Checked = True Then
GoTo suite ': Exit For
End If
Next
MsgBox "Aucune ref n'a été selectionnée": Exit Sub
suite:
Set LstItem = ListView1.SelectedItem
If LstItem Is Nothing Then
Lug = Feuil10.[A65000].End(3).Row + 1: Lig_Fiche = ""
Feuil10.Cells(Lug, 1) = TextBox22.Value
Else
Lug = Lig_Fiche
Feuil10.Activate
Range(Cells(Lug, 6), Cells(Lug, 100)).ClearContents
'Next
End If
With Feuil10
.Cells(Lug, 2) = Txt2
E = 5
For Op = 1 To 27
.Cells(Lug, E) = Controls("Ctrl" & Op)
E = E + 1
Next
K = 34
N = ListView2.ListItems.Count
For N = 1 To N
'ListView2.ListItems.Add N, , N
.Cells(Lug, K) = ListView2.ListItems(N).SubItems(1)
If ListView2.ListItems(N).Checked = True Then .Cells(Lug, K + 1) = "Actif"
K = K + 2
Next
E = 64
For Op = 1 To 23
If Controls("Euro" & Op) <> "" Then
'Feuil10.Cells(Lug, E) = CDbl(Controls("Euro" & Op))
Feuil10.Cells(Lug, E) = Val(Controls("Euro" & Op))
Else
Feuil10.Cells(Lug, E) = 0
End If
E = E + 1
Next
End With
Call Balais
Call CompleteListview1
Call NumFiche
Txt2.Locked = False
End Sub